January 2013
3 posts
4 tags
Generate Hashed Passwords and Salts With Python
Here’s a code snippet you can use to generate hashed passwords and salts for those passwords, as well as verify an input password against a hashed password and salt:
Usage
>>> hashed, salt = hash_password('password123')
>>> print hashed
7845386cd6e73893d12ded643b3bbffe9dc367daa7e52....
>>> print salt
812d47da9c41400e8f07495020a17f92
>>>...
6 tags
Easy Backup of MongoLab Databases for Heroku
For WODWatcher, I needed an easy-to-use script for backing up my MongoLab database. I wrote this script to be used from within my project directory, it should work for your app directory easily as well.
In addition to defaulting to Heroku+MongoLab, you can also pass it any valid MongoDB URI.
For Heroku+MongoLab:
home/my_heroku_project$ ./mongobackup.py [-o output directory]
For general...
4 tags
WODWatcher - Get texted when it's time to get... →
I’m excited to announce my latest project: WODWatcher.
WODWatcher will send you an SMS alert (text message) every time your gym updates their website with the workout of the day. Currently it’s only available for my gym, CrossFit Invoke.
If you’d like to be able to watch your gym with WODWatcher, have one of your gym’s owners e-mail me at jason@wodwatcher.com or send...
November 2012
2 posts
1 tag
2 tags
October 2012
3 posts
4 tags
An Update to jQSlickWrap
Earlier today, @AlmogBaku submitted the first ever pull request to the github project for jQSlickWrap. He added the ability to have the image rendered as the background-image of the parent div by its src parameter, as opposed to using a data-URI. I think this approach may be better than the data-URI mechanism I was using before, so maybe it’ll become the default in the future.
...
4 tags
I'm Joining Republic Wireless! (Bandwidth.com)
Working at TransLōc for nearly two and a half years has been a fantastic experience:
I’ve learned a lot about working at a web company, especially one which deals with huge amounts of data and interesting user interface / interaction design and development challenges.
I’ve been able to interact directly with clients in many capacities: support, usability testing, and even a bit of...
3 tags
Algorithms in JavaScript: Binary Search
I’m going to start a new blog series: Algorithms in JavaScript. This first article will discuss the implementation of “Binary Search”.
The Problem
You’ve got a huge array of sorted values and you need to find the location in that array of a particular value (or whether that value exists within the list at all.)
Brute Force (And Why It Sucks)
The simplest approach to...
July 2012
22 posts
2 tags
CrossFit Invoke Paleo Challenge - Day 29
I finally got Mike Wooten into the gym to try it out, he may actually consider joining! Yesterday was a killer WOD:
5 Rounds
5 Thrusters @ 95lbs
200m run with 20lb medicine ball
12 box jumps @ 24”
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
Alcohol
Cheat
Veggies
Water
Coffee
7/2/12
3
2
2
7
7/3/12
3
2
2
...
2 tags
CrossFit Invoke Paleo Challenge - Days 26, 27 & 28
Though I didn’t get to go to the send-off for Christmas on Saturday, this weekend was all kinds of fun. Nathan and I finished our check-out dives for SCUBA certification! I’m looking forward to being able to finally dive with Paula - she’s been trying to get me to certify ever since we started dating.
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
...
2 tags
CrossFit Invoke Paleo Challenge - Day 25
Boring data-only-update!
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
Alcohol
Cheat
Veggies
Water
Coffee
7/2/12
3
2
2
7
7/3/12
3
2
2
7
7/4/12
3
2
2
7
7/5/12
3
2
2
7
7/6/12
3
2
2
7
7/7/12
3
2
1
6
7/8/12
...
3 tags
CrossFit Invoke Paleo Challenge - Day 24
Yesterday was the last pool-day for my Scuba certification course. It’s been tough waking up early enough to leave work by 4PM while still having a full day, getting to the gym before class, then diving for 3 hours in a pool - all while maintaining a minimum of 7 hours of sleep. This weekend will be another test as well. We have to be at an old quarry by 7:45 AM on both Saturday and Sunday,...
2 tags
CrossFit Invoke Paleo Challenge - Day 23
Earlier, I mentioned how I have become a bit addicted to Almond Butter. After doing some reading, I learned that almonds and almond butter are things to try to moderate a bit due to their high Omega-6 content. I was a little bummed at first, until this morning at Whole Foods when I found this:
Problem Solved.
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
Alcohol
...
2 tags
CrossFit Invoke Paleo Challenge - Day 22
One week left!
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
Alcohol
Cheat
Veggies
Water
Coffee
7/2/12
3
2
2
7
7/3/12
3
2
2
7
7/4/12
3
2
2
7
7/5/12
3
2
2
7
7/6/12
3
2
2
7
7/7/12
3
2
1
6
7/8/12
3
2
...
2 tags
CrossFit Invoke Paleo Challenge - Days 19, 20, 21
Oops! I accidentally forgot that an omlette I ordered from a diner had cheese in it until I was halfway finished on Saturday. I guess I have to dock myself two points for that transgression. As far as Sunday goes, however, I was perfect Paleo and even got to do some mobility work while waiting for my turn to hang glide!
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
...
2 tags
CrossFit Invoke Paleo Challenge - Day 18
This weekend I discovered how nice of a treat some Almond Butter can be when you’re on Paleo, but I need to keep reminding myself that it still has a lot of calories and not a ton of nutrients.
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
Alcohol
Cheat
Veggies
Water
Coffee
7/2/12
3
2
2
7
7/3/12
3
2
2
...
2 tags
CrossFit Invoke Paleo Challenge - Days 16, 17
Just a boring update… trying to keep this ‘spreadsheet’ going.
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
Alcohol
Cheat
Veggies
Water
Coffee
7/2/12
3
2
2
7
7/3/12
3
2
2
7
7/4/12
3
2
2
7
7/5/12
3
2
2
7
7/6/12
3
2
2
...
2 tags
CrossFit Invoke Paleo Challenge - Day 15
We found our 1-rep maxes for the Front Squat and Split Jerk yesterday at the gym, mine are 200lbs and 195lbs respectively. I was really happy with the 195lb split jerk! Also, it turns out that the “High and Valley” burger from Chuck’s, (without a bun) with a side salad is a delicious paleo lunch. Om nom nom.
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
...
2 tags
CrossFit Invoke Paleo Challenge - Days 12, 13, 14
I didn’t get around to posting the scores from Friday, Saturday, and Sunday, so here they are:
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
Alcohol
Cheat
Veggies
Water
Coffee
7/2/12
3
2
2
7
7/3/12
3
2
2
7
7/4/12
3
2
2
7
7/5/12
3
2
2
7
7/6/12
3
2
...
4 tags
CrossFit Invoke Paleo Challenge - Day 11
I finally got Tim from work to go to Invoke with me. The WOD was 3 attempts for a best time on the rower at 500m. We were both completely smoked after rowing our brains out for only a total of about 4.5 minutes of work each. After the class, we stuck around for Yoga. I was so shaky from the rowing that I couldn’t hold very many yoga poses during the first half of the class.
Paleo...
3 tags
CrossFit Invoke Paleo Challenge - Day 10
I opted to have a mobility day on day 10 because my thoracic spine was bothering me. I spent about 45 minutes with a foam roller, my lacrosse ball peanut, and a 35lb plate. Check out this episode of MobilityWOD for more details.
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
Alcohol
Cheat
Veggies
Water
Coffee
7/2/12
3
2
2
7
7/3/12
3
...
3 tags
CrossFit Invoke Paleo Challenge - Day 9
If you haven’t noticed, I’ve stopped providing details as to my weight loss and mood. I’m going to keep those details limited to once every week (on Fridays) and the last day of the challenge.
For lunch on Day 9 I had a shake consisting of an entire can of Whole Foods Organic Coconut Milk and a scoop of GNC’s Cookies & Creme Protein Powder. It was unbelievably tasty...
3 tags
CrossFit Invoke Paleo Challenge - Day 8
It seems like things are getting easier and easier, but I still really crave a diet soda! Also, I had some “Chicken Tinga” from the Whole Foods hot bar yesterday at lunch and ended up eating some food which was cooked with Canola oil in the process. I’m docking myself 2 points for that error. Oops.
Day 8’s WOD
5 rounds:
200m Run
7 handstand push-ups (I did plyo-box...
2 tags
CrossFit Invoke Paleo Challenge - Days 6 & 7
One week is done! And my score is perfect (with a few extra points thanks to Nathan joining me for the WOD on the fourth)!
I took rest days on Saturday and Sunday by getting a massage on Saturday and doing Yoga at the gym on Sunday.
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
Alcohol
Cheat
Veggies
Water
Coffee
7/2/12
3
2
2
...
3 tags
CrossFit Invoke Paleo Challenge - Day 5
I managed to go to a birthday party on Friday (day 5) and stay completely paleo. I didn’t drink anything but seltzer water and unsweetened ice tea, and ate a house salad with a big slab of grilled chicken on it. I didn’t even put dressing on the salad. Take that, carbs!
We did the “Bear Complex” as our WOD on Friday, the Men’s RX weight was 95 pounds. I did 75 lbs...
2 tags
CrossFit Invoke Paleo Challenge - Day 4
Day 4
It seems like weekdays/work-days are the easy days to stay strict Paleo. I didn’t have any trouble with the diet on day 4.
Day 4’s Stats
Height
5’ 10”
Weight
223.1 lbs
Mood
I feel so alert!
Day-to-Day Loss
0.7 lbs
Overall Loss
4.1 lbs
Paleo Challenge Points So Far
Date
Strict
WOD
Sleep
Mobility
Alcohol
Cheat
Veggies
Water
Coffee
...
3 tags
CrossFit Invoke Paleo Challenge - Day 3
Day 2 Recap
I really started craving some diet soda on day 2, but I held strong! Instead of having to consume a boatload of phenelalanine just to get the bubbly texture I find so refreshing - I bought a 12 pack of seltzer water from the grocery store. It’s awesome!
For dinner on Day 2, I was in kind of a rush and couldn’t make anything at home. I dropped by a Wendy’s and...
3 tags
CrossFit Invoke Paleo Challenge - Day 2
Day 1 wasn’t too bad, I had my steak and broccoli dinner. (Note: an entire package of frozen broccoli, 5 servings, is only 150 calories!) However, my dreams last night were kind of upsetting. I kept dreaming that I was drinking diet soda and attempting to eat bread. After waking up this morning - 7.5 hours later - I stepped onto a scale for a nice surprise:
Day 2’s Stats
Height
...
4 tags
CrossFit Invoke Paleo Challenge - Day 1
Today is day 1 of the CrossFit Invoke Paleo Challenge. Yesterday I made a ton of meals for the week, most of which involved four of my all-time favorite vegetables:
Zucchini
Yellow Squash
Asparagus
Spinach (raw)
There is no good reason to force myself into eating vegetables I don’t enjoy, so I’ll stick with what I like for now.
Day 1’s Breakfast
I really love that we...
3 tags
Prelude to the Paleo Challenge
It’s been a long time since I’ve posted anything, and for that: I’m sorry. I’m going to try and get back into blogging more regularly. I’ve got a few ideas cooked up for development-related posts:
My first two weeks with Vim,
Graphite - A JavaScript graph toolkit,
Advanced Google Maps API topics, and
WebGL with Three.JS.
I also want to start writing about my...
March 2012
2 posts
3 tags
Generate Random Passwords with Python
Use this function to generate completely random passwords or other strings with python:
3 tags
Introducing tellmehowtomakemybrowserfullscreen.com →
I was writing up a FAQ section for some documentation at work and we needed a quick way to tell users how to make their browser full screen, so I wrote this site.
I made a custom User Agent sniffer in PHP, you can fork the project here.
February 2012
1 post
6 tags
Google Maps API in an AMD Module (RequireJS /...
At my day job I do a lot of work with the Google Maps JavaScript API. We’ve recently been getting more into using RequireJS for our new projects, and one of the things I originally struggled with was that I’d need to include an additional <script> tag in the markup just for Google Maps.
Until I discovered how to wrap the Google Maps API in an AMD Module:
This module can...
September 2011
1 post
4 tags
How to correctly debounce a JavaScript function.
This function correctly debounces a function that is anticipated to be called many times with identical input in a short amount of time:
July 2011
1 post
3 tags
Singleton Pattern with RequireJS
Here’s a quick Gist on how to create a singleton with RequireJS.
September 2010
2 posts
6 tags
New Gist: How to use Dojo to keep your footer at... →
It’s not easy, at least as far as I can tell, to have a footer on a page which does all of the following:
Sticks to the bottom of the window when the window is larger than the body contents,
attaches to the bottom of the body contents when the window is shorter, and
will move to the bottom of floated body contents (acknowledge their height when figuring out where it should go).
What this...
6 tags
How to kick off a TestSwarm job from jQuery...
Towards the end of last week I set up an instance of John Resig’s TestSwarm server here at TransLoc. In case you’re not familiar with it, here’s an excerpt of the description from the TestSwarm wiki at GitHub:
TestSwarm provides distributed continuous integration testing for JavaScript. It was initially created by John Resig as a tool to support the jQuery project and has since...
August 2010
1 post
6 tags
July 2010
2 posts
5 tags
Anonymous Classes with JavaScript and Self-Calling...
I was messing around with Firebug today, trying to test out a concept for event handling and I didn’t want to have to go through all the pomp and circumstance of creating a legitimate class in the firebug console so I dreamed up a way to make an anonymous class. Here’s what I came up with: (I left out the event handling stuff)
var a = new (function(name){
this.sayHello =...
3 tags
Badass JavaScript: Brain.js →
A neural network is “a mathematical model or computational model that tries to simulate the structure and/or functional aspects of biological neural networks” according to Wikipedia. Basically, a neural network carries out pattern recognition, very much like the human brain would. The user…
Wow, what a great idea… It’d be interesting to integrate machine learning stuff like...
June 2010
3 posts
2 tags
Badass JavaScript: jQSlickWrap: Wrap Text Around... →
Flattered to be featured by badassjs!
Jason Feinstein has written a plugin for jQuery called jQSlickWrap, which allows text to flow around the actual contents of the image instead of the bounding box. This is useful if your images have a transparent background, in which case jQSlickWrap enables text to flow within the…
You should always have a side project, too. Side projects give you an outlet,...
– defunkt (via dhotson)
May 2010
3 posts
JSConf 2010 Slides →
dhotson:
“For those of us who didn’t make it, I’ve compiled a list of slides + blog posts from the JSConf 2010 Track A speakers”
.. will check these out a bit later.
.. me too!
3 tags
April 2010
3 posts
4 tags
Firefox Heads-up Display for Developers →
Looks like we might have a potential competitor to Firebug coming out soon… This is exciting!
… an interactive Console to help web developers understand everything that happens during the creation of a web-page. Console entries will be time-stamped objects representing errors, network traffic, javascript events, DOM/HTML mutation and logging output. The Console will also have an...
March 2010
1 post
3 tags