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/sh | |
# Inpiration: http://engineeringblog.yelp.com/2016/05/yelp-android-app-went-on-a-diet.html | |
# `-lossless` not used to give support for Android 4.0+ | |
# Make sure cwebp is installed. | |
if ! type "cwebp" > /dev/null; then | |
echo "Please install cwebp to continue:" | |
echo "brew install webp" | |
exit 1 | |
fi |
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 React from 'react'; | |
import { | |
View, | |
Text, | |
} from 'react-native'; | |
import { TextInputMask } from 'react-native-masked-text' | |
export default function maskedInputTemplate(locals) { | |
if (locals.hidden) { | |
return null; |
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
let gifts = [ "partridge in a pear tree", "Two turtle doves", "Three French hens", | |
"Four calling birds", "Five golden rings", "Six geese a-laying", | |
"Seven swans a-swimming", "Eight maids a-milking", "Nine ladies dancing", | |
"Ten lords a-leaping", "Eleven pipers piping", "Twelve drummers drumming" ] | |
let nth = [ "first", "second", "third", "fourth", "fifth", "sixth", | |
"seventh", "eighth", "ninth", "tenth", "eleventh", "twelfth" ] | |
func gifts(for day: Int) -> String { | |
var result = "On the \(nth[day-1]) day of Christmas, my true love sent to me:\n" |
(also know as lies and/or alternative facts)
- setImmediate - doesn't set anything immediately, waits for a tick before executing
- setTimeout(fn, n) - never sets the timeout to exactly n
- Math.random() - computers cannot generate random numbers
- Promise - is a lie when rejected
- Array.reduce - accumulates, does not reduce (via @sbmadhav)
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 | |
while true | |
do | |
wget -q --tries=10 --timeout=20 --spider http://google.com | |
if [[ $? -eq 0 ]]; then | |
echo "Online" | |
else | |
echo "Offline" | |
echo raspberry | sudo -S sudo reboot | |
fi |
OlderNewer