Skip to content

Instantly share code, notes, and snippets.

View kellishaver's full-sized avatar

Kelli Shaver kellishaver

View GitHub Profile
@kellishaver
kellishaver / .rspec
Created February 13, 2020 20:18
Fun Rspec matcher
# lives in ~/.rspec
# update path to formatter.rb as needed - I also put it in ~/ :)
--require ~/formatter.rb --format GroupingFormatter
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
# 3. Clear 'Processed' and 'Failed' jobs
@kellishaver
kellishaver / FlappyArmy.ino
Last active January 15, 2019 19:00
Flappy Guy Army Control Code
#include <IRremote.h>
// FanGates control MOSFET transistors
int FanGates[5] = {3,5,6,9,10};
// Individual states for each Gate (on 1/off 0)
int FanState[5] = {0};
// Array of power levels for each fan
int FanSpeeds[5] = {0};
define :guitar_chords do
in_thread do
4.times do
with_fx :echo, mix: 0.3, phase: 0.25 do
sample :guit_em9, rate: 1
end
sleep 4
end
end
end
@kellishaver
kellishaver / mood_lamp.ino
Created March 12, 2016 04:08
Mood Lamp Sketch
int pulseSpeed = 5;
int ldrPin = 0;
int redLed = 10;
int greenLed = 11;
int blueLed = 9;
int ambientLight;
int power = 150;
@kellishaver
kellishaver / keymap.c
Created February 13, 2016 19:38
Planck Custom Keymap
#include "planck.h"
#define _QW 0
#define _CM 1
#define _DV 2
#define _LW 3
#define _RS 4
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QW] = { /* Qwerty */
>form action="/users" method="post">
<input type="hidden" name="is_guest_account" value="true">
<input type="submit" value="Try it!">
</fprm>
* {
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
}
::-moz-selection {
background:#444;
color:#fff;
text-shadow:none;
@kellishaver
kellishaver / gist:bb8b3a2473b54860f568
Created September 21, 2014 07:03
Customize your command prompt with useful Git info
export TERM=xterm-256color
MAGENTA=$(tput setaf 9)
ORANGE=$(tput setaf 172)
YELLOW=$(tput setaf 190)
PURPLE=$(tput setaf 141)
BOLD=$(tput bold)
RESET=$(tput sgr0)
export MAGENTA
@kellishaver
kellishaver / Automated Client Side Init
Last active August 29, 2015 14:06
Automated init and build scripts for client-side projects
Sometimes you want to keep it simple and create just the basics that you need to start from a clean slate.
I keep `Gruntfile.coffee`, the `package.json` file and the `client-side-init.rb` file in `~/builerplates`. Then I added the alias to my `bash_profile`.
To start a new project I just run:
client-side-init my-project-name
Then I can just `cd` into `~/www/my-project-name` run `grunt` and get to work.