View after_streamline.js
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
function create_(record) { | |
var table = record._table | |
try { | |
var fields = prepareFields(record, table, { _version: 1 }) | |
} catch (err) { | |
throw err | |
} | |
checkKeys_(table, record) |
View before_streamline.js
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
function create(record, callback) { | |
var table = record._table | |
try { | |
var fields = prepareFields(record, table, { _version: 1 }) | |
} catch (err) { | |
return callback(err) | |
} | |
checkKeys(table, record, function(err) { |
View Error propagation
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
f1(function(err) { | |
console.log(err); | |
}); | |
function f1(callback) { | |
// throw new Error("You can catch me."); | |
f2(function(err) { | |
if (err) return callback(err); | |
View node-init.js
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
/** | |
* Copyright (c) 2011 Bruno Jouhier <bruno.jouhier@sage.com> | |
* | |
* Permission is hereby granted, free of charge, to any person | |
* obtaining a copy of this software and associated documentation | |
* files (the "Software"), to deal in the Software without | |
* restriction, including without limitation the rights to use, | |
* copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the | |
* Software is furnished to do so, subject to the following |
View browserize.js
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
// foo.js | |
console.log('foo'); | |
require('bar').print(); | |
//bar.js | |
exports.print = function() { | |
console.log('bar'); | |
} |
View gist:839545
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
// Synchronous form - 6 lines | |
function f() { | |
a() | |
b() | |
c() | |
d() | |
} | |
// Asynchronous form - 12 lines | |
function f(callback) { |
View gist:967683
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
# Returns parsed CSS | |
def extract_css | |
css = @dom.css('style, link[rel=stylesheet]').collect do |node| | |
next unless /^$|screen|all/ === node['media'].to_s | |
node.remove | |
if node.name == 'style' | |
node.content | |
else | |
uri = %r{^https?://} === node['href'] ? node['href'] : File.join(@stylesheets_path, node['href'].sub(/\?.+$/,'')) |
View gist:1474598
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
package main | |
type SomeCollection struct { | |
members []int | |
} | |
func (this *SomeCollection) Append(i int) { | |
this.members = append(this.members, i) | |
} |
View classify_version.js
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
Causes.SomeClass = Causes.classify({ | |
init : function() { | |
this.value = 0; | |
$('#something').on('click', this.handlerFunc.bind(this)); | |
}, | |
handlerFunc : function(event) { | |
event.preventDefault(); | |
this.value += 5; | |
}, |
View gist:4627333
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
.nav-item { | |
&:nth-child(1) { | |
@media {min-width: 200px) { | |
display: none; | |
} | |
} | |
&:nth-child(2) { | |
@media {min-width: 250px) { | |
display: none; |
OlderNewer