Debug you complex Sass right to the browser!
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
Ruby: chained vs nested 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
<!DOCTYPE html><html><head><script type="text/javascript"> | |
var i = 0; | |
function print(message){ console.log(i+' '+message) } | |
function main(callback){ | |
print('main') | |
i++; | |
if(i < 6) window.setTimeout( no_arg, 100); | |
else callback('I was passed to 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
#!/bin/sh | |
SD=$(dirname "${BASH_SOURCE[0]}") | |
function echo_blue { echo "\033[34m$1\033[0m"; } | |
function echo_green { echo "\033[32m$1\033[0m"; } | |
function echo_red { echo "\033[31m$1\033[0m"; } | |
function echo_magenta { echo "\033[35m$1\033[0m"; } | |
####################### PARAMETER CHECKS ###################################### |
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
#!/bin/sh | |
# treeclone - pretty much just a wrapper around cp but only for cloning the | |
# CONTENTS of a directory (via /. ) recursively (-a) and non-destructive (-n) | |
# by default. Useful for preventing disaster from forgetting -n | |
if [ "$#" -eq 1 ]; then TO=$CALLER | |
elif [ "$#" -lt 4 ]; then TO=$2 | |
else | |
echo "incorrect number of args: treeclone takes at 1 - 3 args" | |
echo "This will copy all file and directories recursively but not overwrite anything:" |
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
#!/bin/sh | |
# faux nesting for bash 3 using indexes or keys. | |
# See explanation below | |
function nested { | |
# find array referred to by arg 1 | |
local container=${1}[@] | |
local container=(${!container}) | |
# if arg 2 an integer, use normally: | |
if [[ $2 =~ ^-?[0-9]+$ ]]; then |
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
#!/bin/sh | |
# node-appgen | |
SD=$(dirname "${BASH_SOURCE[0]}") | |
CALLER_PATH=$(pwd) | |
COPY_SRC="$SD/node-appgen-default" | |
INSTALLER="$SD/node-appgen-default/node-appgen-installs" | |
EMAIL=$(git config user.email || "") | |
AUTHOR=$(git config user.name || id -F || id -un || whoami) |
OlderNewer