This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
var $backtotop = $('#backtotop'); | |
var top = $(window).height() - $backtotop.height() - 200; | |
function moveBacktotop() { | |
$backtotop.css({ top: top, right: 0}); | |
} | |
$backtotop.click(function () { | |
$('html,body').animate({ scrollTop: 0 }); | |
return false; | |
}); | |
$(window).scroll(function () { |
BIN = ./node_modules/.bin | |
SRC = $(wildcard src/*.coffee) | |
LIB = $(SRC:src/%.coffee=lib/%.js) | |
build: $(LIB) | |
lib/%.js: src/%.coffee | |
@mkdir -p $(@D) | |
@$(BIN)/coffee -bcp $< > $@ |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
{ | |
"cmd": ["gcc", "${file}", "-o", "${file_path}/${file_base_name}.o"], | |
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
"working_dir": "${file_path}", | |
"selector": "source.c", | |
"variants": | |
[ | |
{ | |
"name": "Run", |
exports['forEachSeries'] = function(test){ | |
var args = []; | |
async.forEachSeries([1,3,2], function(x, callback){ | |
setTimeout(function(){ | |
args.push(x); | |
callback(); | |
}, x*25); | |
}, function(err){ | |
test.same(args, [1,3,2]); | |
test.done(); |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShow:) | |
name:UIKeyboardWillShowNotification | |
object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillHide:) |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShow:) | |
name:UIKeyboardWillShowNotification | |
object:nil]; | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillHide:) |
// Include gulp | |
var gulp = require('gulp'); | |
// Include Our Plugins | |
var sass = require('gulp-sass'); | |
var lr = require('tiny-lr'), | |
refresh = require('gulp-livereload'), | |
server = lr(); |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
// Configure the cell... | |
if (!cell) { | |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault | |
reuseIdentifier:CellIdentifier] autorelease]; | |
} |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
// Configure the cell... | |
if (!cell) { | |
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault | |
reuseIdentifier:CellIdentifier] autorelease]; | |
} |