A Pen by Trevor Brindle on CodePen.
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
ask(){ | |
tput bel | |
while true; do | |
if [ "${2:-}" = "Y" ]; then | |
prompt="Y/n" | |
default=Y | |
elif [ "${2:-}" = "N" ]; then | |
prompt="y/N" | |
default=N | |
else |
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 | |
# Notes: | |
# - To list all possible packages, run `android list sdk -all --extended` | |
# - If install operation fails, it may be because selected module is obsolete | |
# - Enable --dry-mode on `android update sdk` to show what will be installed while actually doing nothing | |
# - `tools` and `platform-tools` install the newest package available | |
# - Build Tools - build-tool-xx.x.x selects a specific version to install | |
# - SDK Platforms - android-{API_Level} installs the SDK Platform for XX API Level ex. android-23 or android-19 | |
# - System Images - sys-img-{architecture}-{platform}-android-{API_Level} ex. sys-img-x86_64-android-23 or sys-img-armeabi-v7a-android-23 |
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
ask(){ | |
tput bel | |
while true; do | |
if [ "${2:-}" = "Y" ]; then | |
prompt="Y/n" | |
default=Y | |
elif [ "${2:-}" = "N" ]; then | |
prompt="y/N" | |
default=N | |
else |
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 | |
PARAMS=('-m 6 -q 70 -mt -af -progress') | |
if [ $# -ne 0 ]; then | |
PARAMS=$@; | |
fi | |
cd $(pwd) |
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
tell application "System Preferences" | |
activate | |
set the current pane to pane id "com.apple.Network-Link-Conditioner" --delay 3 | |
end tell | |
--- | |
tell application "System Events" | |
tell application process "System Preferences" | |
get checkboxes | |
click ((checkboxes of window "Network Link Conditioner") whose description is "enable switch") | |
end tell |
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
(function() { | |
const fetchJSON = function(url) { | |
return Q.Promise((resolve) => { | |
const xhr = new XMLHttpRequest(); | |
xhr.open('GET', url); | |
xhr.onreadystatechange = function() { | |
if (xhr.readyState === 4 && xhr.status === 200) { | |
if (xhr.getResponseHeader('Content-Type') === 'application/json') { | |
resolve(JSON.parse(xhr.responseText)); | |
} |
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 | |
project=$(pwd) | |
OLD_MD5=`cat $project/sencha/.app-es6.md5` | |
CURRENT_MD5=`tree -Ds -P '*.js' --timefmt %T $project/sencha/app-es6 | md5` | |
if [ "$OLD_MD5" != "$CURRENT_MD5" ]; then | |
tree -Ds -P '*.js' --timefmt %T $project/sencha/app-es6 | md5 > $project/sencha/.app-es6.md5 | |
npm run build-prod |
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
// http://docs.sublimetext.info/en/latest/reference/build_systems/configuration.html#variants | |
{ | |
"shell_cmd": "make", | |
"selector": ["source.js", "source.scss"], | |
"working_dir": "${folder}", | |
"variants": [{ | |
"name": "Styles", | |
"shell_cmd": "make styles" | |
}, { | |
"name": "Transpile", |
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 | |
expect -c " | |
set timeout -1; | |
spawn android update sdk --no-ui --all --filter tools,platform-tools,android-22,$(android list sdk -u -a -e | grep 'build-tools-' | head -n 2 | tail -n 1 | cut -d' ' -f4 | tr -d '"'),extra-android-m2repository,extra-google-m2repository,extra-google-google_play_services,extra-google-webdriver,extra-intel-Hardware_Accelerated_Execution_Manager; | |
expect { | |
\"Do you accept the license\" { exp_send \"y\r\" ; exp_continue } | |
eof | |
} | |
" |