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
| c i s = take i (repeat "") ++ [s] | |
| fb = zipWith (++) (cycle (c 2 "Fizz")) (cycle (c 4 "Buzz")) | |
| fizzbuzz = zipWith (\x y -> if null x then show y else x) fb [1..] |
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 python | |
| from itertools import cycle, izip | |
| def lazy_fizzbuzz(n): | |
| """ | |
| Returns iterator over fizzbuzz printout, starting at 1 and ending at n (inclusive) | |
| """ | |
| c = lambda i, s: cycle(([''] * i) + [s]) | |
| fb = ('%s%s' % x for x in izip(c(2, 'Fizz'), c(4, 'Buzz'))) |
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 | |
| allowed_ssid="everything" | |
| capture_path="$HOME/captures" | |
| # only take a photo when at work (connected to work network) | |
| check_wireless=$(/sbin/iwconfig wlan0 | grep "ESSID:\"$allowed_ssid\"") | |
| if [ -n "$check_wireless" ]; then | |
| streamer -s 1280x720 -f jpeg -o "$capture_path/$(date +%Y%m%d.%H%M).jpeg" |
NewerOlder