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
Your name and email address were configured automatically based | |
on your username and hostname. Please check that they are accurate. | |
You can suppress this message by setting them explicitly: | |
git config --global user.name "Your Name" | |
git config --global user.email you@example.com | |
After doing this, you may fix the identity used for this commit with: | |
git commit --amend --reset-author |
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 generateJSONFile(spec) { | |
var | |
json = JSON.stringify(specAttributes, null, 2), | |
file = new FileWriter("c:/temp/" + spec + ".json"); | |
file.write(json); | |
file.close(); | |
} |
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 withoutStrict() { | |
console.log(this) | |
} | |
function withStrict() { | |
"use strict"; | |
console.log(this) | |
} | |
withoutStrict() //object window |
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 sleep(milliSeconds) { | |
let startTime = Date.now(); | |
while(Date.now() < startTime + milliSeconds); | |
} | |
//it will hold the thread in 10 seconds | |
sleep(10000); |
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/bash | |
alias git-commit='TortoiseGitProc.exe /command:commit' | |
alias git-log='TortoiseGitProc.exe /command:log' | |
alias git-diffall='TortoiseGitProc /command:showcompare /revision1:HEAD~1 /revision2:0000000000000000000000000000000000000000' | |
# Personal customization | |
# export PS1="\u@\W $ " # username @ working dir | |
export PS1="\e[1;32m\u@\e[1;34m\W\e[m $ " # username @ working dir | |
# export PS1="\e[1;32m$\e[m " # username @ working dir |
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 collection = [ | |
{name:"Lidy", gender:"female"}, | |
{name:"", gender:"unknown"}, | |
{name:"Guto", gender:"male"}, | |
{name:"Daniel", gender:"male"}, | |
{name:"", gender:"unknown"}, | |
{name:"Edy", gender:"male"}, | |
{name:"Udit", gender:"male"}, | |
{name:"Scott", gender:"male"}, | |
{name:"", gender:"unknown"}, |
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 numbers = [0,1,2,-2,-1]; | |
console.log('Default: ' + numbers.sort()); | |
function asc(a, b) { | |
return a-b; | |
} | |
function desc(a, b) { |
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
def get = { param -> | |
mockRequest.httpRequest.getParameter(param) | |
} | |
def name = get "param1" | |
def resource = get "param2" | |
log.info "Parameters: ${param1} and ${param2}" |
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 scores = [1, 4, 6, 8]; | |
var result = scores.reduce((total, score) => total + score) / scores.length; | |
console.log(result); // 4.75 |
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
// Poisoning Object.prototype | |
Object.prototype.bar = 1; | |
var foo = {goo: undefined}; | |
console.log(foo.bar); // 1 | |
console.log('bar' in foo); // true | |
console.log(foo.hasOwnProperty('bar')); // false | |
console.log(foo.hasOwnProperty('goo')); // true |