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
/** | |
* r-proto-class.js | |
* Ruby's semantics | |
* | |
* Features: | |
* - super calls | |
* - using Object.create for inheritance | |
* - Class.new is a wrapper over Class.allocate and Class.initialize | |
* | |
* by Dmitry Soshnikov <[email protected]> |
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
var express = require('express'), | |
app = express(), | |
http = require('http'), | |
httpProxy = require('http-proxy'); | |
//Express config | |
//app.set('view engine', 'ejs'); | |
//app.set('views', __dirname + '/views'); | |
app.use(express.cookieParser()); | |
app.use(express.methodOverride()); |
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
// Case 1: | |
// Bind clean way. | |
var obj = { | |
a: 'obj ', | |
fn: function (b) { | |
console.log(this.a + b); | |
}, | |
attachEvents: function () { | |
this.attachEvent('onSomething', this.fn.bind(this, 'argB')); | |
} |
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
var hex2rgb = function (hex) { | |
return hex.match(/(\w{2})/gi).map(function(n){return parseInt(n,16);}); | |
}; |
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
var getDeferred = function (i) { | |
var deferred = new $.Deferred(); | |
setTimeout(function () { | |
if (--i) { | |
deferred.resolve(i); | |
} else { | |
deferred.reject(i); | |
} | |
}, 2000); |
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 loadContent(href, pushState) { | |
var el = $('<div></div>'); | |
el.load(href + ' .placeholder', function (response, status, xhr) { | |
if (status === 'error') { | |
w.location = href; | |
} else { | |
if (pushState) { | |
window.history.pushState({}, document.title, href); | |
} |
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
"NeoBundle Scripts----------------------------- | |
if has('vim_starting') | |
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
set runtimepath+=/Users/marekpawlowski/.vim/bundle/neobundle.vim/ | |
endif |
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
find . -type f -name '*.js' -exec sed -i '' s/.jsx//g {} + |
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
find . -type f -exec sed -i.orig 's/ / /g' {} + |
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
for i in *.png; do sips -s format jpeg $i --out $i.jpg ;done |
OlderNewer