Skip to content

Instantly share code, notes, and snippets.

View calebeby's full-sized avatar

Caleb Eby calebeby

View GitHub Profile
@calebeby
calebeby / js-cheat-sheet.md
Last active July 18, 2020 21:05
JS Cheat Sheet for Peregrine

JS Cheat Sheet for Peregrine Programming

Make a string:

"some text";

Make a string with a variable embedded in it:

pip (9.0.1)
pynetworktables (2017.0.8)
robotpy-ctre (2017.0.3)
robotpy-hal-base (2017.1.2)
robotpy-hal-roborio (2017.1.2)
robotpy-hal-sim (2017.1.2)
robotpy-wpilib-utilities (2017.0.11)
setuptools (28.8.0)
wpilib (2017.1.2)
audit - 2.3.2-r8.199
avahi-daemon - 0.6.31-r11.1.220
base-files - 3.0.14-r89.49
base-passwd - 3.5.29-r0.172
bash - 4.3-r1.74
busybox - 1.23.1-r0.1.95
busybox-ifplugd - 1.23.1-r0.1.95
busybox-udhcpc - 1.23.1-r0.1.95
coreutils-hostname - 8.23-r0.97
crda - 1.1.3-r0.0
const express = require('express')
const bodyParser = require('body-parser')
const nodemon = require('nodemon')
const {spawn} = require('child_process')
const pull = repo => new Promise((resolve, reject) => {
const gitPull = spawn('git', ['pull'], {cwd: `../${repo}`})
gitPull.stdout.on('data', buf => console.log(buf.toString()))
gitPull.stderr.on('data', buf => console.log(buf.toString()))
gitPull.on('close', code => {code === 0 ? resolve() : reject(code)})
const iterations = 1000000000
var pi = 0
const getPi = () => {
for (let i = 1; i <= iterations; i += 4) {
pi += 4 / i
pi -= 4 / (i + 2)
}
}
import wpilib
from magicbot import magic_motion_profile
class Drive(magic_motion_profile):
robot_drive = wpilib.RobotDrive
left_drive_motor = wpilib.Spark
right_drive_motor = wpilib.Spark
@calebeby
calebeby / patch
Last active December 23, 2016 03:28
From d5eabe108b31308c204fea13008dc23aab08d0fd Mon Sep 17 00:00:00 2001
From: Caleb Eby <caleb.eby01@gmail.com>
Date: Wed, 21 Dec 2016 14:39:18 -0800
Subject: [PATCH] Merge boilerplate
---
.travis.yml | 7 ++-----
README.md | 4 ++--
index.js | 14 +++++++-------
package.json | 8 +++++---
@calebeby
calebeby / 2016_09_15 19_06_09 Thu.qdslog
Last active September 16, 2016 02:47
Qdriverstation log
[11510,[{"d":0,"t":2982}],[{"d":0,"t":2982}],[{"d":0,"t":2982},{"d":100,"t":2984}],[{"d":0,"t":2644}],[{"d":1,"t":2982}],[{"d":2,"t":2983}],[{"d":0,"t":2983}],[{"d":1,"t":2982}],[{"d":0,"t":2982}],[{"d":1,"t":2983}],[{"d":1,"t":2983}],"Log created on: Sep 15 2016 - 19:06:09 PM
Operating System: Antergos Linux
Application name: QDriverStation
Application version: 16.08
------------------------------------------------------------------------
ELAPSED TIME ERROR LEVEL MESSAGE
------------------------------------------------------------------------
00:00.2 DEBUG Initializing DriverStation...
00:00.5 DEBUG DriverStation initialized!
00:01.1 DEBUG Scale factor set to: 1.36392