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
# The SSH Command is necessary to make sure the ssh-add for the agent uses the same binary as your global SSH. | |
# In this case OpenSSH was installed and the Windows 10 Agent was uninstalled. | |
# Prior to this the git client and the ssh-agent were hitting different binaries and the git client kept asking for the passphrase | |
[user] | |
name = Juan_M_Medina | |
email = [email protected] | |
[core] | |
sshCommand = c:/Program\\ Files/OpenSSH-Win64/ssh.exe |
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
// General library function to apply mixins to classes | |
function applyMixins(derivedCtor: any, baseCtors: any[]) { | |
baseCtors.forEach(baseCtor => { | |
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => { | |
derivedCtor.prototype[name] = baseCtor.prototype[name]; | |
}) | |
}); | |
} | |
// An Enum to classify items for pricing |
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
enum OrderType { | |
stationery, | |
food, | |
electronics | |
} | |
enum Priority { | |
low, | |
medium, | |
high |
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 oneSecondCall = function(resolve, reject) { | |
setTimeout(resolve, 1000, 1); | |
}; | |
var twoSecondCall = function(resolve, reject) { | |
setTimeout(resolve, 2000, 2); | |
}; | |
var threeSecondCall = function(resolve, reject) { | |
setTimeout(resolve, 3000, 3); |
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
// Simple one to one assignment | |
var [a, b, c] = [1, 2, 3]; | |
console.log(`a is ${a}`); | |
console.log(`b is ${b}`); | |
console.log(`c is ${c}`); | |
// Assigning the remaining elements | |
var [alpha, beta, gamma, ...theRest] = [1,2,3,4,5,6,7,8,9,10]; | |
console.log(`alpha is ${alpha}`); | |
console.log(`beta is ${beta}`); |
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
"use strict"; | |
var coolPeople = {}; | |
coolPeople[Symbol.iterator] = function* () { | |
yield "Supriya"; | |
yield "Andy (Basu)"; | |
yield "Sachin"; | |
yield "Tom"; | |
}; |
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
"use strict"; | |
/* | |
///------------------------------------------------------------------------------------ | |
/// Hoisting example | |
(function badHoistTest() { | |
console.log(prettyPrint(a)); // 'a' is known, not undefined, declaration is hoisted | |
var a = 'ugly'; // Initializations are NOT hoisted, only declarations; | |
function prettyPrint(input) { |
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
git rm -r --cached . | |
git add . | |
git commit -m ".gitignore is now working" |
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
# I'd do it with cherry-pick -n (--no-commit) which lets you inspect (and modify) the result before committing: | |
git cherry-pick -n <commit> | |
# unstage modifications you don't want to keep, and remove the | |
# modifications from the work tree as well. | |
# this does work recursively! | |
git checkout HEAD <path> | |
# commit; the message will have been stored for you by cherry-pick |
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
$wc=new-object net.webclient; | |
$wp=[system.net.WebProxy]::GetDefaultProxy(); | |
$wp.UseDefaultCredentials=$true; | |
$wc.Proxy=$wp; | |
iex ($wc.DownloadString('https://chocolatey.org/install.ps1')) |