Skip to content

Instantly share code, notes, and snippets.

View TechplexEngineer's full-sized avatar

Blake Bourque TechplexEngineer

View GitHub Profile
@TechplexEngineer
TechplexEngineer / FIRST_Export_Roster.js
Created October 24, 2022 20:34
Export team roster from FIRST dashboard
(()=>{
function convertToCSV(arr) {
const array = [Object.keys(arr[0])].concat(arr)
return array.map(it => {
return Object.values(it).toString()
}).join('\n')
}
if (typeof ContactRosterModel == "undefined") {
@TechplexEngineer
TechplexEngineer / sortPlaylist.js
Last active October 31, 2022 01:22
Added support for Round Robin "RR"
(() => {
// -----------------------------------------------------------------
// CONFIG (you're safe to edit this)
// -----------------------------------------------------------------
// ~ GLOBAL CONFIG
// -----------------------------------------------------------------
const MODE = 'sort_playlist'; // 'publish_drafts' / 'sort_playlist';
const DEBUG_MODE = true; // true / false, enable for more context
// -----------------------------------------------------------------
// ~ PUBLISH CONFIG
@TechplexEngineer
TechplexEngineer / FC_Extract.js
Last active November 24, 2023 16:26
Extract first choice priority list to tab separated values for pasting into a spreadsheet
// ---- First extract the table headers
hdrs = []
$("#PriorityTable tr.cart-header-row").each((idx, row) => {
$("th", row).each((idx2, col)=>{
hdrs.push($(col).text())
})
})
hdrs.push("Part Number")
// console.log("Headers:",hdrs)
@TechplexEngineer
TechplexEngineer / parse.js
Created December 24, 2019 14:52
parse rules from FRC game manual
const ruleData = [];
$('p[class$="Rule"],p[class$="Rules"]').each((idx, rule) => {
const ruleObj = {};
const ruleText = $(rule).find('span:first').text().match(/([A-Za-z])([0-9]+)/i);
if (_.isNull(ruleText)) { return true; }
ruleObj.section = ruleText[1];
ruleObj.number = ruleText[2];

Keybase proof

I hereby claim:

  • I am techplexengineer on github.
  • I am techplex (https://keybase.io/techplex) on keybase.
  • I have a public key ASCZD0EJzrxNgUHnfD0q0_Dz1zHITZzOuWy2Xg0Y4Bn4rQo

To claim this, I am signing this object:

// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Simple Arithmetics Grammar
// ==========================
//
// Accepts expressions like "2 * (3 + 4)" and computes their value.
Expression
= head:Term tail:(_ ("+" / "-") _ Term)* {
return tail.reduce(function(result, element) {
if (element[1] === "+") { return result + element[3]; }
if (element[1] === "-") { return result - element[3]; }
def main():
client = TwitchClient(client_id='a57grsx9fi8ripztxn8zbxhnvek4cp')
# Monkey patch TwitchClient.users to add get_by_name https://github.com/tsifrer/python-twitch-client/pull/52
from types import MethodType
from twitch.resources import User
def get_by_name(self, user_ids):
if isinstance(user_ids, str):
user_ids = [user_ids]
Verifying my Blockstack ID is secured with the address 1LjvWYXonYnt8Q5a7U6q3SdeGvh2zUBW2v https://explorer.blockstack.org/address/1LjvWYXonYnt8Q5a7U6q3SdeGvh2zUBW2v
@TechplexEngineer
TechplexEngineer / bleUUIDfind.cpp
Created July 26, 2017 10:57
Check for a series of bytes in a byte array. https://repl.it/JjHx/1
#include <stdint.h>
#include <stdio.h>
bool checkUuidInScanData(uint8_t* advData, uint8_t advDataLen, uint8_t* bleUUID, uint8_t bleUUIDLen)
{
for (int i = advDataLen; i > bleUUIDLen; --i)
{
for (int j = 0; j < bleUUIDLen; ++j)
{
printf("i=%d a=%x \t j=%d u=%x\n", i, advData[i-j], j, bleUUID[j]);