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
import network | |
import socket | |
import json | |
from machine import Pin | |
LED = Pin("GP21", Pin.OUT) | |
FAVICON = ( |
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
{ | |
"$schema": "https://json-schema.org/draft/2020-12/schema", | |
"definitions": { | |
"Component": { | |
"type": "object", | |
"properties": { | |
"text": { "type": "string" }, | |
"translate": { "type": "string" }, | |
"with": { | |
"type": "array", |
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
import time | |
import board | |
import digitalio | |
import usb_hid | |
from adafruit_hid.consumer_control import ConsumerControl | |
from adafruit_hid.consumer_control_code import ConsumerControlCode | |
def init_pin(pin_id): | |
pin = digitalio.DigitalInOut(pin_id) |
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
import socket | |
import select | |
import struct | |
import time | |
import signal | |
import re | |
import sqlite3 | |
import time | |
import os |
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
import socket | |
import select | |
import struct | |
import time | |
import signal | |
import random | |
import re | |
import http.client | |
import json | |
import os |
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
import os | |
import gzip | |
import re | |
from collections import defaultdict | |
from datetime import datetime, timedelta | |
def log_file_lines(directory): | |
sorted_files = sorted(os.listdir(directory)) | |
for filename in sorted_files: | |
if filename == 'latest.log': |
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 stateLabels = ["A", "B", "C", "D", "E", "F", "G"] as const; | |
type StateLabel = typeof stateLabels[number]; | |
type Direction = "left" | "right"; | |
interface Edge { | |
write: 0 | 1; | |
move: Direction; | |
next: StateLabel; | |
} |
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
import sys | |
from dataclasses import dataclass | |
from itertools import groupby | |
from typing import List | |
from tqdm import tqdm | |
@dataclass | |
class Run: |
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
# Add the following code to ~/.bash_profile or ~/.bashrc | |
function git_branch() { | |
git rev-parse --abbrev-ref HEAD 2> /dev/null | |
} | |
function git_prompt() { | |
local branch=$(git_branch) | |
local deltas=$(git rev-list --left-right --count $branch...origin/$branch 2> /dev/null) | |
local stats=$(git diff --stat 2> /dev/null | tail -n 1) |
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
void main() | |
{ | |
Hive ce = CreateHive(); | |
if (ce) | |
ce.InitOffline(); | |
Weather weather = g_Game.GetWeather(); | |
weather.GetOvercast().SetLimits(0.0, 1.0); | |
weather.GetRain().SetLimits(0.0, 1.0); |
NewerOlder