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
radio.onReceivedValue(function (name, value) { | |
if (name == "roll") { | |
roll = value / 50 | |
} else if (name == "pitch") { | |
pitch = (0 - value) / 50 | |
} else if (name == "shake" ) { | |
pins.servoWritePin(AnalogPin.P1, 90) | |
pins.servoWritePin(AnalogPin.P2, 90) | |
basic.showLeds(` | |
# . . . # |
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
#!/usr/bin/env python3 | |
import cv2 | |
import io | |
import time | |
import picamera | |
import Adafruit_SSD1306 | |
import numpy as np | |
from Adafruit_GPIO import SPI | |
from PIL import Image |
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
/* | |
Print and log csv-style lines with altitude in meters | |
id,lat,long,altitude,isotime | |
0DFFFAABB,41.118233,-112.045356,1632.5,2024-01-13T06:25:21Z | |
*/ | |
#ifndef SOC_BLE_50_SUPPORTED | |
#warning "This SoC does not support BLE5. Try using ESP32-C3, or ESP32-S3" | |
#else | |
#include "FS.h" |
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
root@serial:~# cat /etc/rc.local | |
#!/bin/sh -e | |
# | |
# rc.local | |
# | |
# This script is executed at the end of each multiuser runlevel. | |
# Make sure that the script will "exit 0" on success or any other | |
# value on error. | |
# | |
# In order to enable or disable this script just change the execution |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 openai import OpenAI | |
import os | |
client = OpenAI(api_key=os.getenv('OPENAI_API_KEY')) | |
def get_response(passage): | |
prompt = f'Define each of the words in the following passage in English, Spanish and Chinese:\n\n{passage}' | |
print(prompt) | |
response = client.chat.completions.create(model="gpt-4", messages=[{"role": "user", "content": prompt}]) | |
return response |
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 "DigiKeyboard.h" | |
#define ADC1_P2 1 | |
void setup() { | |
pinMode(1, OUTPUT); | |
} | |
void loop() { | |
char output[32]; |
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
javascript:(function() { | |
document.querySelectorAll("relative-time").forEach(function(el) { | |
var parent = el.parentNode; | |
var timestamp = el.title; | |
var span = document.createElement("span"); | |
span.innerHTML = timestamp.replace(/20\d\d, /,""); | |
parent.removeChild(el); | |
parent.appendChild(span); | |
}); | |
})(); |
NewerOlder