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
function mkdir | |
{ | |
command mkdir $1 && cd $1 | |
} |
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
#models/discussion.rb | |
has_many :posts | |
#models/post.rb | |
belongs_to :discussion | |
#spec/factories/discussions.rb |
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
#loopy loop | |
def fizzBuzz(lim=100): | |
i = 1 | |
while i < lim+1: | |
if i % 15 is 0: | |
print "FizzBuzz!" | |
elif i % 5 is 0: | |
print "Buzz!" | |
elif i % 3 is 0: |
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
//so before you had: | |
if(options.slide == 'up') { $(this).slideUp(time, options.callback);} // slide Up | |
else if(options.slide == 'down') { $(this).slideDown(time, options.callback);} // slide down | |
else if(options.slide == 'toggle') {$(this).slideToggle(time, options.callback);} // slide toggle | |
/**there's a pattern here | |
* if options.slide = up, call slideUp | |
* if it's down, call slideDown | |
* it it's toggle, call slideToggle |
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
Step 1: | |
touch ~/.powconfig | |
echo 'export POW_DOMAINS=rails' >> ~/.powconfig | |
echo 'export POW_DST_PORT=88' >> ~/.powconfig | |
Then reinstall / install Pow, and then load up MAMP, add a new VHost, doesn't matter what you call it at all or where to put as the destination, go into the "Advanced" tab and under "Customised Virtual Host General Settings" add this: | |
ServerName pow | |
ServerAlias *.rails |
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
## Prepare ################################################################### | |
# Remove RVM | |
rvm implode | |
# Ensure your homebrew is working properly and up to date | |
brew doctor | |
brew update | |
## Install ################################################################### |
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
Homebrew & then: Git, Node, NPM, CoffeeScript, wget | |
rbenv & Ruby then gems: Bundler, Rails, Rake | |
Xcode | |
Alfred | |
Sublime Text 2 | |
iTerm 2 | |
ZSH & Oh-my-ZSH | |
Dropbox | |
Evernote |
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
#Unit Testing your JavaScript | |
##About Me | |
* University of Bath Computer Science student | |
* Placement at [Kainos](http://www.kainos.com) | |
* [JavaScript Playground](http://www.javascriptplayground.com) | |
* @Jack_Franklin | |
## Why Test at all? |
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
defaults write org.vim.MacVim MMTextInsetTop '10' | |
defaults write org.vim.MacVim MMTextInsetLeft '10' | |
defaults write org.vim.MacVim MMTextInsetBottom '10' | |
defaults write org.vim.MacVim MMTextInsetRight '10' |
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
var PostsCollection = B.Collection.extend({ | |
model: PostModel, | |
url: "http://hndroidapi.appspot.com/news/format/json/page/", | |
fetch: function(cb) { | |
var ajaxReq = $.ajax({ | |
url: this.url, | |
type: "GET", | |
dataType: "jsonp" | |
}); | |
ajaxReq.done(function(d) { |