Skip to content

Instantly share code, notes, and snippets.

View wgaylord's full-sized avatar

William Gaylord wgaylord

View GitHub Profile
@wgaylord
wgaylord / ESPPacket.py
Last active July 14, 2019 20:37
Files to run.
from legacy import MessageType, Unicode, UVarint, Float32
from legacy import Bool, EmbeddedMessage, Bytes, Flags
Version = MessageType()
Version.add_field(1,"version",UVarint)
Version.add_field(2,"release",Unicode)
Version.add_field(3,"os",Unicode)
Version.add_field(4,"os_version",Unicode)
root@billServer:~/micropython/project/micropython/ports/esp32# make all
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
GEN build/sdkconfig.h
mkdir -p build/bootloader//root/micropython/esp-idf//components/bootloader/subproject/main/
mkdir -p build/bootloader//root/micropython/esp-idf//components/bootloader_support/src/
mkdir -p build/bootloader//root/micropython/esp-idf//components/log/
mkdir -p build/bootloader//root/micropython/esp-idf//components/micro-ecc/micro-ecc/
mkdir -p build/bootloader//root/micropython/esp-idf//components/soc/esp32/
mkdir -p build/bootloader//root/micropython/esp-idf//components/soc/src/
mkdir -p build/bootloader//root/micropython/esp-idf//components/spi_flash/
@wgaylord
wgaylord / main.c
Created January 30, 2020 01:17
Code used on an ESP32 for green satnogs station.
#include <Arduino.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <time.h>
#include <sys/time.h>
#define SSID ""
#define PASSWORD ""
#define NTPSERVER "pool.ntp.org"
#define TOKEN "Token API_KEY"
set APIO_HOME_DIR=C:\Users\chibi\.icestudio\apio& "C:\Users\chibi\.icestudio\venv\Scripts\apio.exe" upload --board upduino21 --verbose-pnr -p "C:\Users\chibi\AppData\Local\Temp\icestudio-12152c8lkqPqY7Fp1"
[Fri Apr 10 23:44:37 2020] Processing upduino21
--------------------------------------------------------------------------------
yosys -p "synth_ice40 -json hardware.json" -q main.v
nextpnr-ice40 --up5k --package sg48 --json hardware.json --asc hardware.asc --pcf main.pcf
Info: Importing module main
Info: Rule checker, verifying imported design
Info: Checksum: 0x5d722337
PS C:\Users\chibi\Desktop\CPP_Programming\PGEHelloWorld> g++ helloworld.cpp -o myProgram.exe -luser32 -lgdi32 -lopengl32 -lgdiplus -lShlwapi -lstdc++fs -std=c++17 >> error.log In file included from C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/filesystem:37,
from olcPixelGameEngine.h:270,
from helloworld.cpp:3:
C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/fs_path.h: In member function 'std::filesystem::__cxx11::path& std::filesystem::__cxx11::path::operator/=(const std::filesystem::__cxx11::path&)':
C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/fs_path.h:237:47: error: no match for 'operator!=' (operand types are 'std::filesystem::__cxx11::path' and 'std::filesystem::__cxx11::path')
|| (__p.has_roo
import re,sys
start = """
#include <stdio.h>
unsigned char memory[256];
unsigned char X;
"""
charInput = """
char Input(){
unsigned char t;
This file has been truncated, but you can view the full file.
[
{
"id": "document",
"name": "display",
"version": "1.0",
"clock": {
"interval": "0000-00-00T00:00:00Z/9999-12-31T24:00:00Z",
"step": "SYSTEM_CLOCK"
}
},
An error occurred while loading the file, which may indicate that it is invalid. A detailed error report is below:
TypeError: Cannot read property 'dayNumber' of undefined
TypeError: Cannot read property 'dayNumber' of undefined
at Function.Yr.addSeconds (https://cesium.com/cesiumjs/cesium-viewer/CesiumViewer.js:23:144569)
at tY (https://cesium.com/cesiumjs/cesium-viewer/CesiumViewer.js:23:1636077)
at rY (https://cesium.com/cesiumjs/cesium-viewer/CesiumViewer.js:23:1636199)
at oY.addSamplesPackedArray (https://cesium.com/cesiumjs/cesium-viewer/CesiumViewer.js:23:1641789)
at sY.addSamplesPackedArray (https://cesium.com/cesiumjs/cesium-viewer/CesiumViewer.js:23:1644485)
at YY (https://cesium.com/cesiumjs/cesium-viewer/CesiumViewer.js:23:1659496)
[[4004, 256, 4, [0, 33, 1, 2, 3354, 4, 70, 10, 3886, 6, 69, 9670, 232], [286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286331153, 286335250, 286331169, 286331153, 287379729, 303239457, 286331153, 286331153, 554766610, 286339345, 555815441, 286331667, 286331409, 286331153, 286331409, 554767121, 554766609, 1092686129, 286331425, 286331411, 554766610, 287445265, 287445281, 554832149, 304156961, 286332177, 286331153, 287379729, 286331153, 554766865, 286396689, 286335521, 286331153, 308417041, 554770706, 286462241, 303174162, 303117073, 571543825, 554774817, 304156962, 286462257, 303174162, 555946801, 303174177, 287379729, 286396706, 286331153, 554770961, 1092686129, 303108385, 1091638803, 571609617, 304222481, 28
@wgaylord
wgaylord / mytypes.py
Last active October 17, 2020 04:53
My hack to get chunks in 1.16.3
from quarry.types.buffer import Buffer
def unpack_chunk(buff):
x, z, full = buff.unpack('ii?') #Get chunk location and if its full
bitmask = buff.unpack_varint() #Bitmask of the chunk sections
heightmap = buff.unpack_nbt() #Get the heightmap?
biomeLength = 0
if full:
biomeLength = buff.unpack_varint() #Get biome length if full