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 list = [1,2,3,4,5,6,7,8,9]; | |
list = list.sort(function() { | |
return Math.random() - 0.5; | |
}); | |
console.log(list); // prints something like: 4,3,1,2,9,5,6,7,8 | |
// For a raffle and 1 person to win. |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
</head> | |
<body> | |
<div class="wrapper"> | |
<main>Main content here.</main> | |
</div> |
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
# Easier navigation: .., ..., ~ and - | |
alias ..="cd .." | |
alias cd..="cd .." | |
alias ...="cd ../.." | |
alias ....="cd ../../.." | |
alias .....="cd ../../../.." | |
alias -- -="cd -" | |
## Use a long listing format ## | |
alias ll='ls -la' |
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 keymap | |
# | |
# Atom keymaps work similarly to style sheets. Just as style sheets use | |
# selectors to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. Unlike style sheets however, | |
# each selector can only be declared once. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# |
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
#!/usr/bin/env bash | |
image_archive="image-archive.tar" | |
image_metadata="docker-image-metadata.tar.gz" | |
function cache_images() { | |
images_to_cache=$(docker images | awk '{print $3}' | grep -v '<none>' | tail -n +2 | while read line; do docker history -q $line | grep -v '<missing>'; done | uniq) | |
if [ -n "$images_to_cache" ]; then | |
printf "Saving the following images:\n$images_to_cache\n\n" |
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
# Easier navigation: .., ..., ~ and - | |
alias ..="cd .." | |
alias cd..="cd .." | |
alias ...="cd ../.." | |
alias ....="cd ../../.." | |
alias .....="cd ../../../.." | |
alias -- -="cd -" | |
## Use a long listing format ## | |
alias ll='ls -la' |
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 generateUUID(n) { | |
return n ? (n ^ 16 * Math.random() >> n / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, generateUUID) | |
} |
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
@mixin spacing($prop: padding, $dir: top, $value: 1) { | |
#{$prop}-#{$dir}: $value; | |
} | |
@function initial($string) { | |
@return str-slice($string, 0, 1); | |
} | |
$properties: ( | |
margin, |
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
import React from "react"; | |
import elementResizeEvent from "element-resize-event"; | |
export default (Component) => { | |
class ComponentWidth extends React.Component { | |
state = { | |
width: 0, | |
}; | |
componentDidMount() { | |
const element = this.targetElement; |
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 delay = require("delay"); | |
const people = [ | |
{ | |
id: 0, | |
name: "Stewie", | |
delay: 200 | |
}, | |
{ | |
id: 1, |