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
# a pretty good overview here | |
# http://openmicros.org/index.php/articles/94-ciseco-product-documentation/raspberry-pi/217-getting-started-with-raspberry-pi-gpio-and-python | |
# quick python overview | |
# indentation is important, things like loops MUST be indented and the first part ends with a colon | |
# for a in b: | |
# do something |
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> | |
</head> | |
<body> | |
<script> | |
var refinerations = 4502212239; |
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
public function link( $url, $title = NULL, $attributes = [], $secure = NULL, $escape = TRUE ) { | |
$url = $this->url->to( $url, [], $secure ); | |
if ( is_null( $title ) || $title === FALSE ) | |
$title = $url; | |
if ( $escape ) | |
$title = $this->entities( $title ); | |
return $this->toHtmlString('<a href="'. $url .'"'. $this->attributes( $attributes ) .'>'. $title .'</a>'); | |
} |
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 dates = [ | |
"2017-01-11", | |
"2017-01-04", | |
"2016-12-21", | |
"2016-12-07", | |
"2016-11-03", | |
"2016-10-27", | |
"2016-10-13", | |
"2016-09-22", | |
"2016-09-15", |
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 timeout = { | |
initial: 10, // start backoff | |
backoff: 1.5, // backoff exponent | |
max: 5000, // maximum retry backoff | |
fail: ( 1000 * 60 * 3 ), // stop retrying after this time | |
loop: 0, // current number of tries | |
}; | |
function getUrl( url ) { | |
if ( ! timeout.start ) |
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
// from https://en.wikipedia.org/wiki/List_of_typefaces_included_with_macOS | |
// 10.7-10.9 | |
Al Bayan, American Typewriter, Andalé Mono, Apple Casual, Apple Chancery, Apple Garamond, Apple Gothic, Apple LiGothic, Apple LiSung, Apple Myungjo, Apple Symbols, .AquaKana, Arial, Arial Hebrew, Ayuthaya, Baghdad, Baskerville, Beijing, BiauKai, Big Caslon, Brush Script, Chalkboard, Chalkduster, Charcoal, Charcoal CY, Chicago, Cochin, Comic Sans, Cooper, Copperplate, Corsiva Hebrew, Courier, Courier New, DecoType Naskh, Devanagari, Didot, Euphemia UCAS, Fang Song, Futura, Gadget, Geeza Pro, Geezah, Geneva, Geneva CY, Georgia, Gill Sans, Gujarati, Gung Seoche, Gurmukhi, Hangangche, HeadlineA, Hei, Helvetica, Helvetica CY, Helvetica Neue, Herculanum, Hiragino Kaku Gothic Pro, Hiragino Kaku Gothic ProN, Hiragino Kaku Gothic Std, Hiragino Kaku Gothic StdN, Hiragino Maru Gothic Pro, Hiragino Maru Gothic ProN, Hiragino Mincho Pro, Hiragino Mincho ProN, Hoefler Text, Inai Mathi, Impact, Jung Gothic, Kai, Keyboard, Krungthep, Ku |
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
# OSX doesn't have a mountpoint command, or concise way to get that info | |
# this is a replacement for the mountpoint command, with the exception that it returns 2 instead of 1 for no argument | |
function mountpoint() { | |
# require a path | |
if [[ -z "$1" ]]; then | |
echo 'mountpoint requires a path as an argument'; | |
echo 'ex. `mountpoint /mnt/some_disk`'; | |
return 2; |
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 a() { | |
return new Promise( ( resolve, reject ) => { | |
let arr = [ 0,1,2,3,4,5 ]; | |
let stop = false; // short circuit the loop | |
arr.forEach(( num ) => { | |
if ( stop ) | |
return; | |
if ( num === 2 ) { | |
resolve( num ); | |
stop = true; |
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/bash | |
OUT='mp3/'; | |
for FILE in *.mp4; do | |
if [ ! -f "$OUT$FILE".mp3 ]; then | |
ffmpeg -n -i "$FILE" -codec:a libmp3lame -qscale:a 0 "$OUT$FILE".mp3; | |
fi; | |
done; |
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
# local | |
echo 'sha384-'"$( cat FILENAME | openssl dgst -sha384 -binary | openssl enc -base64 -A )"; | |
# wget | |
echo 'sha384-'"$( wget -o/dev/null -O- URL_HERE | openssl dgst -sha384 -binary | openssl enc -base64 -A )"; | |
# curl | |
echo 'sha384-'"$( curl -s URL_HERE | openssl dgst -sha384 -binary | openssl enc -base64 -A )"; |
OlderNewer