- Read lots of code.
- Write lots of code.
- Don’t be afraid to throw it away.
- Don’t be afraid to share it.
- Find your happy place writing tests.
- You’ll probably spend more time writing tests and debugging than writing code. Embrace this. Make it a key part of your workflow.
- Tests are one of the first things I read in a module. That and the example(s). Probably before API docs.
- Don’t know where to start. Write some tests for a module you like. This benefits everyone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "rubygems" | |
| require "twitter" | |
| require "json" | |
| # things you must configure | |
| TWITTER_USER = "your_username" | |
| MAX_AGE_IN_DAYS = 1 # anything older than this is deleted | |
| # get these from dev.twitter.com | |
| CONSUMER_KEY = "your_consumer_key" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <array> | |
| <string>FBPlaceAttachmentButtonExperimentContext</string> | |
| <string>FBTimelineHeaderCoverDownloadExperimentContext</string> | |
| <string>FBQuickPromotionDebugLogger</string> | |
| <string>FBStorySeenStateExperimentContext</string> | |
| <string>FBTimelineStoriesChunkRequestExperimentContext</string> | |
| <string>FBTimelineStoriesInfiniteScrollingExperimentContext</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Utilities for quickly accessing frequently used directories in bash. | |
| # Usage: | |
| # $ cd /path/to/project/src/ | |
| # $ mark code # Will create a new shortcut. | |
| # # Becomes interactive if a shortcut already exists | |
| # # m is an alias for mark. You can also `m code` | |
| # | |
| # $ code # From now on, running this anywhere in the shell | |
| # # will put you in /path/to/project/src/code |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Open the developer console of your favorite browser | |
| // on the page of your favorite meetup where you're on the wailist (grrr) | |
| // and paste this by putting your name | |
| // This will actually compute the position in the waitlist div which seems to correspond to the waitlist position | |
| var findPosition = function(username) { return $("#rsvp-list-waitlist h5").map(function(i, el) {return {"pos": i, "name": $(el).text()}}).filter(function(i, el) {return el["name"].indexOf(username) >= 0;})} | |
| findPosition("my displayed name") // where my displayed name is the name that is displayed for you on the meetup |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // By observing changes to an object with Object.observe, | |
| // and turning on Async Call Stacks in Chrome Dev Tools, | |
| // you can find the source of those changes. | |
| var myObject = { | |
| foo: 'bar' | |
| }; | |
| Object.observe(myObject, function(changes) { | |
| // This asynchronous callback runs when myObject is changed |