Skip to content

Instantly share code, notes, and snippets.

View RaneWallin's full-sized avatar
💭
Sprinting

Rane Wallin RaneWallin

💭
Sprinting
View GitHub Profile
@RaneWallin
RaneWallin / hello_epaper3.py
Last active February 2, 2024 14:03
Complete demo project for the Waveshare 2.7" HAT on Raspberry Pi
import sys # import sys
sys.path.insert(1, "./lib") # add the lib folder to sys so python can find the libraries
import epd2in7b # import the display drivers
from PIL import Image,ImageDraw,ImageFont # import the image libraries
import time
from gpiozero import Button # import the Button control from gpiozero
btn1 = Button(5) # assign each button to a variable
btn2 = Button(6) # by passing in the pin number
@RaneWallin
RaneWallin / hello_epaper1.py
Created August 30, 2019 18:06
First program for the Waveshare 2.7" ePaper HAT
import sys
sys.path.insert(1, "./lib")
import epd2in7b
from PIL import Image, ImageDraw, ImageFont
epd = epd2in7b.EPD() # get the display
epd.init() # initialize the display
print("Clear...") # prints to console, not the display, for debugging
epd.Clear(0xFF) # clear the display
@RaneWallin
RaneWallin / hello_epaper2.py
Created August 30, 2019 18:37
A demo project for the 2.7" ePaper HAT from Waveshare, using the display and the buttons
import sys
sys.path.insert(1, "./lib")
import epd2in7b
from PIL import Image, ImageDraw, ImageFont
from gpiozero import Button
btn = Button(5)
epd = epd2in7b.EPD()
@RaneWallin
RaneWallin / rane-wallin-resume.md
Last active December 10, 2020 04:12
Rane Wallin's Resume in Markdown

Rane Wallin

25811 W St Kateri Dr
Buckeye, AZ 85326

(623) 498-7649

Rane is a full stack web developer and Java engineer
@RaneWallin
RaneWallin / emcc.l
Last active November 1, 2020 01:15
Example of a lex file
%option noyywrap
A [a-zA-Z]
DIGIT [0-9]
/* 1. include other pattern definitions here, if needed. Digits maybe? */
%{
#include "tokens.h" /* Leave this section untouched */
@RaneWallin
RaneWallin / bnf_example
Created November 1, 2020 00:28
Backus Normal/Nauer Form example
<program> ::= <statement_list>
<statement_list> ::= <variable_def>
| <assignment_statement>
| <conditional_statement>
| <loop_statement>
| <block_statement>
| <variable_def> <statement_list>
| <assignment_statement> <statement_list>
| <conditional_statement> <statement_list>
| <loop_statement> <statement_list>
@RaneWallin
RaneWallin / main.dart
Created October 30, 2020 18:45
Deck of cards in Dart
void main() {
Deck deck = new Deck();
print(deck.length());
deck.removeCard("Jack", "Hearts");
print(deck.length());
print(deck);
}
class Deck {
@RaneWallin
RaneWallin / query_traits.aql
Last active September 4, 2020 03:40
AQL to get all traits of a game
FOR doc in any 'games/VnZGCbECR0I' edges
OPTIONS { bfs: true, uniqueVertices: 'global' }
return doc.name
// edge cases: no islands, all zeros
// constraints: none
// start with first row
// walk through each index in the row
// if it sees a 1
// check each potential island in array
// check each coordinate
// determine if the stored coordinate is adjacent to the current coordinate