This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int ENABLE_A = 4; | |
const int ENABLE_B = 5; | |
const int SPEED = 6; | |
void setup() { | |
pinMode(ENABLE_A, OUTPUT); | |
pinMode(ENABLE_B, OUTPUT); | |
pinMode(SPEED, OUTPUT); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
public class DoublyIndexedList { | |
private Sprite[][] level; | |
/* ... */ | |
public void set(int x, int y, Sprite sprite) { | |
level[x][y] = sprite; |

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.firstinspires.ftc.teamcode; | |
import com.qualcomm.robotcore.eventloop.opmode.OpMode; | |
import com.qualcomm.robotcore.eventloop.opmode.TeleOp; | |
import com.qualcomm.robotcore.hardware.DcMotor; | |
/** | |
* This is based on the helpful write-up at | |
* https://www.roboteq.com/index.php/component/easyblog/entry/driving-mecanum-wheels-omnidirectional-robots?Itemid=1208 | |
* which itself is pulled from the Simplistic Control of Mecanum Drive from Ian McInerney, FRC Team 2022: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Musical Stairs | |
* | |
* The core assumptions of this code mostly have to do with the sequence in which the | |
* XSHUT pins are wired together: | |
* | |
* 1. All of the XSHUT pins are contiguous on the Arduino, starting at XSHUT_OFFSET. | |
* 2. The pins are ordered L1, R1, L2, R2, ... , L10, R10 | |
* | |
* At the moment, we are triggering a note to be played if REQ_CONSECUTIVE_BREAKS consecutive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <VL53L0X.h> | |
const int NUM_SENSORS = 5; | |
const long SENSOR_TIMEOUT = 25; | |
const long MAX_TESTS = 100; | |
const long MAX_DURATION = 300000; | |
const int XSHUT_OFFSET = 2; // first XSHUT pin | |
VL53L0X sensors[NUM_SENSORS]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <VL53L0X.h> | |
const long SENSOR_TIMEOUT = 500; | |
const long MAX_TESTS = 1000; | |
const long MAX_DURATION = 300000; //ms | |
VL53L0X sensor; | |
int count = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
set screen "tt-rss" | |
set prompt "$" | |
set ttrss "~/public_html/tt-rss" | |
# open a new screen (reusing any existing 'tt-rss' screen) | |
spawn screen -D -R "$screen" | |
expect "$prompt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# usage: iTunesLibraryToggle [library] [playlist] | |
# e.g. iTunesLibraryToggle "$HOME/Music/iTunes (Music & Audiobooks)" Audiobooks | |
iTunesLibraryToggle() { | |
# make sure the iTunes directory is, in fact, a symlink | |
iTunesDir=$HOME/Music/iTunes | |
if [[ ! -d "$iTunesDir" || -L "$iTunesDir" ]] ; then | |