Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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 hidden or 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); | |
}); | |
})(); |
This file contains hidden or 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
# configured for fallback to static ip if not working | |
hostname | |
clientid | |
persistent | |
option rapid_commit | |
option domain_name_servers, domain_name, domain_search, host_name | |
option classless_static_routes | |
option interface_mtu | |
require dhcp_server_identifier |
This file contains hidden or 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
# This file is executed on every boot (including wake-boot from deepsleep) | |
#import esp | |
#esp.osdebug(None) | |
import uos, machine | |
#uos.dupterm(None, 1) # disable REPL on UART(0) | |
import gc | |
#import webrepl | |
#webrepl.start() | |
gc.collect() |
This file contains hidden or 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 | |
# reads from stdin a log captured using: | |
# mosquitto_sub -p 8883 -h $MHOST -t 'msh/+/json/#' -u $MUSER -P $MPASS --tls-use-os-certs -F %J | |
import sys | |
import json | |
import xmltodict | |
stations = {} |
This file contains hidden or 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
# This file is executed on every boot (including wake-boot from deepsleep) | |
#import esp | |
#esp.osdebug(None) | |
import uos, machine | |
#uos.dupterm(None, 1) # disable REPL on UART(0) | |
import gc | |
from machine import Pin, I2C | |
import ssd1306 |
This file contains hidden or 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 sys | |
import shutil | |
# Watch for a .hex file to appear in the Downloads folder | |
# when we see it, copy it to the microbit and then eject the drive | |
# the microbit will reboot with the new code running | |
# To install: |