Skip to content

Instantly share code, notes, and snippets.

Avatar

Kelli Shaver kellishaver

View GitHub Profile
@kellishaver
kellishaver / .rspec
Created Feb 13, 2020
Fun Rspec matcher
View .rspec
# lives in ~/.rspec
# update path to formatter.rb as needed - I also put it in ~/ :)
--require ~/formatter.rb --format GroupingFormatter
View clear-sidekiq-jobs.sh
# 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 Jan 15, 2019
Flappy Guy Army Control Code
View FlappyArmy.ino
#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};
View song.rb
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
View mood_lamp.ino
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 Feb 13, 2016
Planck Custom Keymap
View keymap.c
#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 */
View registrations_controller.rb
>form action="/users" method="post">
<input type="hidden" name="is_guest_account" value="true">
<input type="submit" value="Try it!">
</fprm>
View reset
* {
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 Sep 21, 2014
Customize your command prompt with useful Git info
View gist:bb8b3a2473b54860f568
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 Aug 29, 2015
Automated init and build scripts for client-side projects
View Automated Client Side Init
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.