This file contains hidden or 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 | |
function add_spacer { | |
[[ $1 =~ ^[0-9]+$ ]] && times=$1 || times=1 | |
echo "Adding $times spacer(s)" | |
i=0; | |
while [[ $i -lt $times ]]; do | |
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' | |
((i++)) |
This file contains hidden or 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
// Set the background image for retina devices | |
.background-image-retina(@url, @ext, @width, @height) { | |
@lowres: "@{url}.@{ext}"; | |
@highres: "@{url}@2x.@{ext}"; | |
background-image: url(@lowres); | |
background-size: @width @height; | |
@media | |
only screen and (-webkit-min-device-pixel-ratio: 2), |
This file contains hidden or 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
<?php | |
/** | |
* This function extends get_template_part to include the ability | |
* to pass variables to the template file | |
* | |
* @param $template_names array|string Either a single template name or an array of template names, ordered by priority | |
* @param $variables array The variables to make available to the template | |
*/ | |
function get_template_part_with($template_names, $variables = array()) { |
This file contains hidden or 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 | |
stash_name="wip" | |
echo "> Updating master on all git repositories in the current directory" | |
for dir in */ | |
do | |
if [ -d ${dir}/.git ]; then | |
cd ${dir} | |
stashed=false |
This file contains hidden or 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
curl https://raw.githubusercontent.com/creationix/nvm/v0.23.3/install.sh | bash | |
nvm install iojs-1.4.2 | |
nvm install v0.12.0 | |
nvm alias io iojs-1.4.2 | |
nvm alias node v0.12.0 | |
nvm use io |
This file contains hidden or 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
api | |
.get('episodes') | |
.orderBy(['matId']) | |
.where({'shortName': 'The Riverside Show'}) | |
.go() | |
.then((episodes) => { | |
// episodes is an array of Episode instances, not just plain objects | |
}); | |
// or even |
This file contains hidden or 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 ObjectCache from '../ObjectCache'; | |
import ObjectStoreDriver from '../drivers/ObjectStoreDriver'; | |
let cache = new ObjectCache(ObjectStoreDriver); | |
let requests = 0; | |
let cacheHits = 0; | |
function getData () { | |
let cached = cache.get('apidata'); |
This file contains hidden or 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 node | |
var options = require('minimist')(process.argv.slice(2), { default: { | |
cport: 8888 | |
}}); | |
var disable = options.disable || options.d; | |
var enable = options.enable || options.e; | |
var status = options.s || options.status; | |
var child = require('child_process'); |
This file contains hidden or 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 input = "(((())))()((((((((())()(()))(()((((()(()(((()((()((()(()()()()()))(((()(()((((((((((())(()()((())()(((())))()(()(()((()(()))(()()()()((()((()(((()()(((((((()()())()((((()()(((((()(())()(())((())()()))()(((((((())(()())(()(((())(()))((())))(()((()())))()())((((())))(()(((((()(())(((()()((()((()((((((((((())(()())))))()))())()()((((()()()()()()((((((())())(((()())()((()()(((()()()))(((((()))(((()(()()()(()(()(((())()))(()(((()((())()(()())())))((()()()(()()(((()))(((()((((()(((((()()(()())((()())())(()((((((()(()()))((((()))))())((())()()((()(()))))((((((((()))(()()(((())())(())()((()()()()((()((()((()()(((())))(()((())()((((((((()((()(()()(((())())())))(())())))()((((()))))))())))()()))()())((()())()((()()()))(()()(((()(())((((())())((((((((()()()()())))()()()((((()()))))))()((((()(((()))(()()())))((()()(((()))()()())())(((())((()()(())()()()(((())))))()())((()))()))((())()()())()())()()(()))())))())()))(())((()(())))(()(())(()))))(()(())())(()(())(()(()))))((()())()))()((((()()))))())))()()())( |
This file contains hidden or 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 fetch from 'node-fetch'; | |
const OPERATIONS = { | |
'AND': (x, y) => x & y, | |
'OR': (x, y) => x | y, | |
'NOT': (value) => ~ value, | |
'LSHIFT': (x, y) => x << y, | |
'RSHIFT': (x, y) => x >> y | |
} |