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
def slack_it(msg): | |
''' Send a message to a predefined slack channel.''' | |
import urequests | |
# Get an "incoming-webhook" URL from your slack account. @see https://api.slack.com/incoming-webhooks | |
URL='https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX' | |
headers = {'content-type': 'application/json'} | |
data = '{"text":"%s"}' % msg |
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/python3 | |
import serial | |
import time | |
class Screen(object): | |
def __init__(self, port, speed): | |
self.serial = serial.Serial(port, speed, timeout=0.05) | |
print("Opened on port: {}".format(self.serial.name)) | |
self.x = 10.0 |
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
trees =[] | |
with open('input') as data: | |
for line in data: | |
trees.append([int(x) for x in line.strip()]) | |
red = [[]]*10 | |
grn = [[]]*10 | |
blu = [[]]*10 | |
def interp(val, xmin, ymin, xmax, ymax): |
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
speedtest-cli | |
fastcli | |
adafruit-io |
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 | |
# See reddit post where people wanted to see it: https://www.reddit.com/r/adventofcode/comments/rgacln/2021_day_14_less_than_optimal_solution/ | |
# I just copy/pasted this from my input, instead of dealing with the input parsing. | |
poly = 'PBFNVFFPCPCPFPHKBONB' | |
pairs = {} | |
with open('input', 'r') as inp: | |
for line in inp: |
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
! Trying to F*** with my keyboard. | |
! | |
! The theory is that if I make the caps lock be the "Mode_switch" key, | |
! then I can change what happens for each key when I press the "Mode_switch" key. | |
! | |
! I'm not using the "Mode_switch" key anyway... | |
! | |
! This will make the caps lock be the "Mode_switch" key. | |
clear Lock |
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/sh | |
# | |
# Write/remove a task to do later. | |
# | |
# Select an existing entry to remove it from the file, or type a new entry to | |
# add it. | |
# | |
file="$HOME/.todo" | |
touch "$file" |
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/python3 | |
# | |
# A little python script that can act enough like a Marlin printer to test out a UART screen. | |
# I connected it to the screen with an FTDI. It connects at /dev/ttyUSB0 | |
import serial | |
import time | |
class Screen(object): | |
def __init__(self, port, speed): |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>Flask React</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- styles --> | |
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
</head> |
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
#include "median.h" | |
#include <string.h> | |
// Storage for the input to the median filter. | |
double data[MEDIAN_FILTER_SIZE]; | |
double median_data[MEDIAN_FILTER_SIZE]; | |
// Pointer to the next element in the median filter. Not very safe programming! | |
double* pNextDataInput = data; |
NewerOlder