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
if ($elem.scrollTop() + $elem.innerHeight() >= $elem[0].scrollHeight) { console.log(bot scroll reached!); } |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>The HTML5 Herald</title> | |
<meta name="description" content="The HTML5 Herald"> | |
<meta name="author" content="SitePoint"> |
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
[alias] | |
new = "!f() { echo start; git checkout -b $1 --track ${2- origin/Develop}; }; f"; |
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
Update-Database -Script –SourceMigration $InitialDatabase |
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
npm version patch -m "Version %s - added more documentationc" |
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
// Fix that gives ability to import json files without TypeScript errors | |
declare module '*.json' { | |
const value: any; | |
export default value; | |
} |
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
const originalPush = Array.prototype.push; | |
Array.prototype.push = function newPush() { | |
console.log('before push'); | |
originalPush.call(this, arguments[0]); | |
console.log('after push'); | |
} | |
let x = []; | |
x.push('a'); |
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 MyArray(arr) { | |
const _arr = arr || []; | |
this.push = function push(value) { | |
console.log('prepush'); | |
_arr.push(value) | |
console.log('postpush'); | |
} | |
this.get = function getByIndex(index) { |
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 spyFactory(array) { | |
const interceptor = { | |
get: function (obj, prop) { | |
if (prop !== 'push') { return obj[prop]; } | |
return function(...args) { | |
console.log('prepush'); | |
Array.prototype.push.apply(this, args); | |
console.log('postpush'); | |
} |
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 spyFactory(array, prepushHandler, postpushHandler) { | |
const prepush = functionify(prepushHandler); | |
const postpush = functionify(postpushHandler); | |
const interceptor = { | |
get: function (obj, prop) { | |
if (prop !== 'push') { return obj[prop]; } | |
return function (...args) { | |
prepush(args); | |
Array.prototype.push.apply(this, args); |
OlderNewer