This file contains 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
module.js:340 | |
throw err; | |
^ | |
Error: Cannot find module 'commander' | |
at Function.Module._resolveFilename (module.js:338:15) | |
at Function.Module._load (module.js:280:25) | |
at Module.require (module.js:362:17) | |
at require (module.js:378:17) | |
at Object.<anonymous> (/usr/local/lib/node_modules/coffee-watcher/lib/coffee-watcher.js:4:13) | |
at Object.<anonymous> (/usr/local/lib/node_modules/coffee-watcher/lib/coffee-watcher.js:30:4) |
This file contains 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
#import <UIKit/UIKit.h> | |
@interface QuizViewController : UIViewController | |
{ | |
int currentQuestionIndex; | |
// the model objects, pointers here. Referenced in QuizViewController.m | |
NSMutableArray *questions; | |
NSMutableArray *answers; | |
This file contains 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
# /app/models/user.rb | |
def update_credentials(client) | |
new_client = client.refresh! | |
update(access_token: new_client.token, refresh_token: new_client.refresh_token) | |
self | |
end |
This file contains 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
# /app/models/user.rb | |
# because this code is in user.rb, the user is implied | |
# because you're in the user model, you can call methods on user without `user.` | |
# so user.access_token becomes access_token | |
# contact me zack@stopcoin.com with questions | |
def create_client | |
@tokens = { | |
access_token: access_token, |
This file contains 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
# /app/models/user.rb | |
def balance(client) | |
client.balance.to_f | |
end |
This file contains 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
# /app/models.order.rb | |
def sell_users_coins | |
begin | |
client = user.create_client | |
balance = user.balance(client) | |
# some code related to selling the actual bitcoins | |
# logic, edge case checks, etc. | |
This file contains 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
tom, dick, harry | |
marge, homer, bart |
This file contains 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
import UIKit | |
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { | |
var items: [String] = ["We", "Aenean lacinia bibendum nulla sed consectetur.", "Vestibulum id ligula porta felis euismod semper. Maecenas sed diam eget risus varius blandit sit amet non magna. Sed posuere consectetur est at lobortis. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Etiam porta sem malesuada magna mollis euismod. Sed posuere consectetur est at lobortis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.", "Blah", "one two three", "Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam.", "gum gum gum gum", "Blah", "one two three", "Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam.", "gum gum gum gum", "Blah", "one two three", "Donec sed odio dui. Cras justo odio, d |
This file contains 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
# this assumes you have brew installed – http://brew.sh/ | |
# and oh-my-zsh – https://github.com/robbyrussell/oh-my-zsh | |
# First, create a new zshell script | |
cd ~/.oh-my-zsh/plugins | |
mkdir your-plugin | |
cd your-plugin | |
# create the empty script doc |
This file contains 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
func showStreakIndicator(#today: NSDate, yesterday: NSDate?, tomorrow: NSDate?) -> (top: Bool, bottom: Bool) { | |
var tuple = (top: false, bottom: false) | |
let calendar = NSCalendar.currentCalendar() | |
if yesterday == nil && tomorrow == nil { | |
tuple.top = true | |
return tuple | |
} |
OlderNewer