Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import socket
import struct
import time
import random
ip = "10.0.1.255"
pixel_channels_start = 0
pixel_channels_end = 15
#define Servo1In 2
#define Servo2In 3
unsigned long lastServo1 = 0;
unsigned long Servo1Time = 0;
unsigned long lastServo2 = 0;
unsigned long Servo2Time = 0;
unsigned long longestTime = 0;
unsigned long shortestTime = 0-1;
#include <SoftwareSerial.h>
#define ARDUINO_RX 5//should connect to TX of the Serial MP3 Player module
#define ARDUINO_TX 6//connect to RX of the module
SoftwareSerial mySerial(ARDUINO_RX, ARDUINO_TX);
static int8_t Send_buf[8] = {0} ;
const int buttonPin = 2;
int buttonState = 0;
int buttonStateOld = 0;
#define CMD_SEL_DEV 0X09
#define DEV_TF 0X02
@blhack
blhack / gist:ba93610ae12d2f58c2faa08b6ea3103c
Last active April 20, 2020 16:12
Watch all the Rising with Krystal and Saagar clips in a playlist instead of having to find them on youtube
from bs4 import BeautifulSoup
import urllib
import parse
req = urllib.urlopen("https://www.youtube.com/channel/UCPWXiRWZ29zrxPFIQT7eHSA/videos")
data = req.read()
vIDs = []
soup = BeautifulSoup(data, "html.parser")
for link in soup.find_all("a", class_="yt-uix-sessionlink yt-uix-tile-link spf-link yt-ui-ellipsis yt-ui-ellipsis-2"):
//import fs
const fs = require('fs').promises;
//this opens a file called app.json, parses it as json, changes a value, and then saves it.
//put this in an async function
const increment = async () => {
//first open the file
const appJson = await fs.readFile('app.json', 'utf8');