- [Data Structures] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#data-structures)
- [Linked Lists] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#linked-lists)
- [Trees] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#trees)
- [Binary Trees] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#binary-trees)
- [Binary Search Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#binary-search-tree)
- [Red-Black Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#red-black-tree)
- [AVL Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#avl-tree)
- [Tries] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#tries)
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 know dict's have `.get()`, this example was made to break if the key is not | |
# there to show the use of multiple try/except's | |
# Yes I know that having the except and else on 1 line each does not fit with PEP8 standards. | |
# But when you have many of them it helps reduce the size of the file and is no harder to read | |
data = {'some_key': 'key value'} | |
key_data = None | |
for _ in range(1): | |
try: | |
key_data = data['someKey'] |
wfh, work from home
Yeah, Okay.
Sureeee.
https://cdn.meme.am/instances/66329129.jpg
http://gifrific.com/wp-content/uploads/2012/04/Jon-Hamm-Sure-Thing.gif
http://i.imgur.com/seh6p.gif
http://www.reactiongifs.com/wp-content/uploads/2013/11/yea-k.gif
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
# http:#eslint.org/docs/rules/ | |
ecmaFeatures: | |
binaryLiterals: false # enable binary literals | |
blockBindings: false # enable let and const (aka block bindings) | |
defaultParams: false # enable default function parameters | |
forOf: false # enable for-of loops | |
generators: false # enable generators | |
objectLiteralComputedProperties: false # enable computed object literal property names | |
objectLiteralDuplicateProperties: false # enable duplicate object literal properties in strict mode | |
objectLiteralShorthandMethods: false # enable object literal shorthand methods |
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
/************************************************************************ | |
* CLIENT ONE-LINERS | |
*************************************************************************/ | |
// Set top level domain cookie. | |
document.cookie = "token=12345; Max-Age=120; Secure; Domain=mozilla.org; Path=/;" | |
// Set a subdomain cookie. | |
document.cookie = "name=hello world; Max-Age=120; Secure; Domain=developer.mozilla.org; Path=/;" |
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
# Check which process is using a port. | |
lsof -i tcp:57454 | |
# Bash scrict mode. | |
# http://redsymbol.net/articles/unofficial-bash-strict-mode/ | |
#!/bin/bash | |
set -euo pipefail | |
IFS=$'\n\t' | |
# Exit script if you try to use an uninitialized variable. |
You can serve your project websites for free on GitHub Pages.
Normally, I use gulp to generate a minified and concatenated build inside the build/
directory,
and then use git subtree
to push only the build/
directory to the gh-pages branch (without needing
to push the build to master).
git subtree push --prefix build origin gh-pages
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 pixelated images and svg by removing this line. | |
svg, | |
img { | |
image-rendering: -webkit-optimize-contrast; | |
} | |
// Spinning React logo | |
.App-logo { | |
animation: App-logo-spin infinite 20s linear; | |
height: 80px; |
NewerOlder