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
const http = require('http') | |
const options = { | |
hostname: 'api.ipify.org', | |
port: 80, | |
path: '/?format=JSON', | |
method: 'GET', | |
} | |
exports.handler = (event, context, 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/bash | |
if [ $# -ne 2 ]; then | |
echo Run a given command on a file when it is modified. | |
echo Usage: runonfileonchange command file | |
exit 1 | |
fi | |
while inotifywait -e modify $2; do | |
$1 $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
from microbit import * | |
import music | |
class PinButton: | |
def __init__(self, pin): | |
self.pin = pin | |
self.was_pressed_last_update = False | |
self._was_pressed = False |
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 | |
description="Run make when any files passed as arguments are modified." | |
usage="Usage: makeonfilechange [files]" | |
if [ $# = 0 ]; then | |
echo $description | |
echo $usage | |
exit 1 | |
fi |