An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 bindContext(object){ | |
return new Proxy({ | |
get: function(target, key){ | |
if(typeof target[key] === 'function' && !target.hasOwnProperty(key)){ | |
return target[key].bind(target); | |
} | |
return target[key]; | |
} | |
}); |
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 saveSomething(something, callback){ | |
var saved = righto(saveValue, something); | |
var updatedLastSavedTime = righto(updateLastSaveTime); | |
// We want the result of `saved`, but only after `updatedLastSavedTime` succeeds. | |
var result = righto.after(saved, updatedLastSavedTime); | |
result(callback); | |
} |
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 linux python 3 instructions see https://gist.github.com/softwaredoug/a871647f53a0810c55ac | |
# Install python manager | |
brew install pyenv | |
# Install virtual environment manager | |
brew install pyenv-virtualenv | |
# Update your .zshrc |
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 found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
# So here's a minimal Gist which worked for me as an install on a new M1 Pro. | |
# Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration | |
# | |
# Let's get started | |
# | |
# Let's install nix (at the time of writing this is version 2.5.1 | |
curl -L https://nixos.org/nix/install | sh | |
# I might not have needed to, but I rebooted |