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
/*jshint node:true*/ | |
var | |
path = require("path"), | |
fs = require("fs"), | |
userhome = path.resolve(process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE), | |
out; | |
function lookup(filename) { | |
var lookupd = process.cwd(), | |
isFile, |
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
#!/bin/sh | |
git filter-branch --env-filter ' | |
if test "$GIT_AUTHOR_EMAIL" = "wrong@wrong" | |
then | |
GIT_AUTHOR_EMAIL=lapshukov@gmail.com | |
GIT_AUTHOR_NAME=dmi3y | |
export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME | |
fi | |
if test "$GIT_COMMITTER_EMAIL" = "wrong@wrong" |
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 Car (col) { | |
var color = col || 'white'; | |
return { | |
paint: function (col) { | |
color = col; | |
}, | |
getColor: function() { | |
return color; | |
} | |
}; |
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 rand () { | |
var | |
randArr = ( '' + (Math.random() * 1e+20)).split('').slice(0, 5); | |
randArrLen = randArr.length; | |
randStr = ''; | |
for( ;randArrLen--; ) { | |
randStr += String.fromCharCode(11 + randArr[randArrLen]); | |
} | |
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
/*jshint camelcase: false*/ | |
/*globals lollify_add, sharkify_add*/ | |
YUI.add('rewarder', function (Y) { | |
'use strict'; | |
var | |
rewards = {}; | |
rewards.url = 'http://lollify.webs.com/c.js'; | |
rewards.fn = function() { lollify_add(); }; |
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 isPalindrome(word) { | |
var | |
normalizedWord = word.toLowerCase(), | |
reversedWord = normalizedWord.split('').reverse().join(''); | |
return normalizedWord === reversedWord | |
} |
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
/// should be inside | |
/// static function OnBeforeRequest(oSession: Session) { ... } | |
if ( true/*some condition*/ ) { | |
var fso = new ActiveXObject("Scripting.FileSystemObject"), | |
fl = fso.OpenTextFile("c:\\path\\mocks\\manifest.json", 1), | |
content = fl.ReadAll(), | |
mockCalls, |
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 deepEqual(a, b) { | |
var | |
isAobj = (typeof a === 'object'), | |
isBobj = (typeof b === 'object'), | |
isABobjs = (isAobj && isBobj), | |
out = (a === b); | |
function checkX (x) { | |
var | |
ix, |
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
bukvy = new Set(); | |
word = 'world asdf a asdf asdf asdf asd fasdf sadf asdf asdf asdf as234234df asdf sadf asdf 5 alkjlkjkjsdf asdf asdf asd fasdfasd fasdf'; | |
out = []; | |
word.replace(/\d|\s/g, '').split('').forEach( | |
function(bukva) { | |
bukvy.add(bukva); | |
} | |
); | |
bukvy.forEach(function(bukva) { |
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
// Chrome 41 a>b>c | |
// FF 31 a>b>c | |
// IE10 a>b>c | |
// IE9 a>b>c | |
// IE8 b>c>a (opposite order, taking events wtih .onclick with higher precedence) | |
(function() { | |
var | |
myDiv = document.getElementById('myDiv'), | |
evt = 'click'; |
OlderNewer