Skip to content

Instantly share code, notes, and snippets.

View dlareau's full-sized avatar

Dillon Lareau dlareau

View GitHub Profile
exit() {
if [[ -z $TMUX ]]; then
builtin exit
else
tmux detach
fi
}
@dlareau
dlareau / template_contents.html
Created April 30, 2018 20:04
hunt1_template_contents
{% extends "hunt_base.html" %}
{% block title %}Puzzles!{% endblock title %}
{% block content %}
<div class="container">
<div class="row">
<div class="content col-md-6">
<h1 class="title">Unlocked Puzzles</h1>
<a href='/objects/' >
<p style="margin-top: -5px;"> Click here for unlocked objects </p>
@dlareau
dlareau / test.c
Last active January 19, 2019 01:21
Sample prints
Serial.print("words ");
Serial.print(5)
Serial.println(" More words")
int8_t
uint8_t
unsigned int i = -5;
Serial.printf("words %d more words\n", i);
@dlareau
dlareau / crossword.cpp
Last active March 19, 2019 11:53
crossword maker
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <unordered_set>
using std::cin;
using std::ifstream;
@dlareau
dlareau / can_pd.patch
Last active February 21, 2020 05:17
sigrok decoder can rtr fix
iff --git a/decoders/can/pd.py b/decoders/can/pd.py
index 3dbadc0..e47018f 100644
--- a/decoders/can/pd.py
+++ b/decoders/can/pd.py
@@ -263,6 +263,7 @@ def decode_standard_frame(self, can_rx, bitnum):
# Bit 12: Remote transmission request (RTR) bit
# Data frame: dominant, remote frame: recessive
# Remote frames do not contain a data field.
+ self.rtr = self.bits[12]
rtr = 'remote' if self.bits[12] == 1 else 'data'
@dlareau
dlareau / actions.txt
Created August 8, 2020 17:03
Action when player count is decremented
Reese Clark gets caught stealing third base.
Joshua Butt gets caught stealing third base.
Elvis Figueroa gets caught stealing third base.
Sutton Picklestein gets caught stealing second base.
Castillo Turner gets caught stealing third base.
Taiga Quitter gets caught stealing third base.
Dickerson Morse gets caught stealing third base.
Hendricks Rangel gets caught stealing third base.
Workman Gloom gets caught stealing third base.
Declan Suzanne gets caught stealing third base.
@dlareau
dlareau / pbp.txt
Created August 10, 2020 19:44
00018bf4-9498-4ec7-ad49-cdf0a60efbed
Play ball!
Top of 1, Philly Pies batting.
Top of 1, Philly Pies batting.
Eduardo Woodman batting for the Pies.
Strike, looking. 0-1
Strike, looking. 0-1
Eduardo Woodman hit a ground out to Dudley Mueller.
Beasley Day batting for the Pies.
Beasley Day batting for the Pies.
Ball. 1-0
('797e472e-17e7-48ec-b072-bea2fbbb4852', 8, 9, 'awayTeamBatterCount skipped a batter.34 -> 36', (8, True, 0, 0, 'Pedro Davids batting for the Crabs.', 2, 0, 30, 36))
('abc2f506-84a5-4001-b501-85497415e9d1', 7, 10, 'homeTeamBatterCount skipped a batter.32 -> 34', (7, False, 0, 0, 'Allison Abbott batting for the Garages.', 2, 0, 34, 29))
('1001a4c0-375a-4063-8abe-4413b9f51fdd', 7, 10, 'homeTeamBatterCount skipped a batter.32 -> 34', (7, False, 0, 0, 'Eizabeth Elliott batting for the Magic.', 2, 1, 34, 38))
('bfd100db-acc9-4540-b9c5-6299bc1c96e3', 6, 10, 'homeTeamBatterCount skipped a batter.25 -> 27', (6, False, 0, 0, 'Kichiro Guerra batting for the Lovers.', 0, 0, 27, 30))
('5b1af6b8-35f2-4590-a4cc-24d120d64117', 7, 9, 'awayTeamBatterCount skipped a batter.26 -> 28', (7, True, 0, 0, 'Mcdowell Sasquatch batting for the Tacos.', 2, 0, 32, 28))
('c0334c4e-b401-46ac-b102-2adfe74a2074', 6, 9, 'awayTeamBatterCount skipped a batter.25 -> 27', (6, True, 0, 0, 'Dominic Marijuana batting for the Millennials.', 2, 0, 37,
@dlareau
dlareau / gist:26431f6337b44f7ce91cc4bf7d4328cb
Created August 19, 2020 02:43
datablase player, team, and game draft
CREATE TABLE IF NOT EXISTS player(
player_id varchar(36) PRIMARY KEY, /* Use the uuid as the primary key */
captured_at timestamp /* The timestamp when this player data was fetched from the site. */
/* Or better yet if we can get it the timestamp the change took effect */
name text
deceased boolean
/* blaserunning */
base_thirst decimal
continuation decimal
@dlareau
dlareau / sample.sql
Last active August 19, 2020 19:31
Sample queries
/* The proposed tables */
/* multi-table */
CREATE TABLE IF NOT EXISTS attr_table(
id SERIAL PRIMARY KEY,
everything /* pretend this expands to the 20 or so player fields */
);
CREATE TABLE IF NOT EXISTS player_table(
id SERIAL PRIMARY KEY,