Skip to content

Instantly share code, notes, and snippets.

def speak_hour(hour)
hour = 0 if hour == 24
{
0 => "midnight",
1 => "one",
2 => "two",
3 => "three",
4 => "four",
6 => "six",
var SHEET_ID = "17lRx0wgx9f2JutGKKFfkHmbrkqgsy7nf6IDJL07w-Vs";
var SHEET_NAME = "downloads";
function doGet(event) {
return handleResponse(event);
}
function doPost(event) {
return handleResponse(event);
}
require 'json'
require 'open-uri'
require 'open3'
STREAMS_URL = 'https://mixlr-codetest.herokuapp.com/stations/netil-radio/streams'
def fetch_streams(url = STREAMS_URL)
body = URI.open(url).read
json = JSON.parse(body)
json.dig('data', 'attributes', 'streams')
require 'json'
require 'open-uri'
require 'open3'
STREAMS_URL = 'https://mixlr-codetest.herokuapp.com/stations/netil-radio/streams'
body = URI.open(STREAMS_URL).read
json = JSON.parse(body)
volumes = json.dig('data', 'attributes', 'streams').map do |stream_name, url|
0x56baCa0397AD8ff17F59EA5b19ea6708E7A550fb
if ping -q -c 5 -W 1 192.168.1.1 > /dev/null; then
echo "IPv4 is up"
else
echo "IPv4 is down"
fi
docker run -d --name='mediabox-webdav' -v '/mnt/user/appdata/mediabox-webdav':'/config':'rw' -v '/mnt/disks/mediabox-webdav':'/mnt/mediaefs':'rw,shared' --device='/dev/fuse' --cap-add SYS_ADMIN 'mumiehub/rclone-mount'
docker exec -it mediabox-webdav sh
rclone config --config /config/.rclone.conf
# trzeba zdefiniować zasób o nazwie "mediaefs"
@qoobaa
qoobaa / init.lua
Created January 2, 2017 16:43
SDS011 + ESP8266
DEVICE_ID="pmsensor-" .. string.format("%02X", node.chipid())
BOOT_WAIT = 3
DWEET_INTERVAL = 60
LED_PIN = 4
pm25 = nil
pm10 = nil
function led(state)
<html>
<body>
<form onsubmit="event.preventDefault(); createToken()">
number: <input id="card-number" value="4111111111111111"><br>
name: <input id="card-name" value="John Doe"><br>
due date: <input id="card-due-date" value="1/2020"><br>
cvv: <input id="card-cvv" value="123"><br>
<input type="submit" value="create token">
</form>
length = 66.5;
width = 18.75;
height = 13;
thickness = 1;
module spring(radius, width, height, thickness, $fn = 12) {
for (sx = [1, -1]) {
scale([sx, 1, 1]) {
cube([(width / 2 - radius) / 2 + thickness, thickness, height + thickness]);
translate([width / 2 - radius + thickness, 0, 0]) {