Skip to content

Instantly share code, notes, and snippets.

View kellishaver's full-sized avatar

Kelli Shaver kellishaver

View GitHub Profile
@kellishaver
kellishaver / Loading-Animation.markdown
Created October 22, 2013 03:18
A Pen by Kelli Shaver.
@kellishaver
kellishaver / gist:8012670
Created December 17, 2013 21:09
Developer's Creed
This is my text editor. There are many like it, but this one is mine.
My text editor is my best friend. It is my life. I must master it as I must master my life.
My text editor, without me, is useless. Without my text editor, I am useless. I must use my text editor efficiently.
I must code faster than my approaching deadline which is trying to kill me. I must debug before it arrives. I will...
My text editor and I know that what counts in this project is not the lines of code we write, the automated testing, nor the code linters we use.
@kellishaver
kellishaver / image-analyze.rb
Last active January 3, 2016 07:39
Analyze an image for the 10 most common colors and their percentage.
require 'RMagick'
include Magick
puts "Enter the path to the image you wish to analyze:"
file = gets.chomp
image = Magick::ImageList.new(file)
q = image.quantize(10, Magick::RGBColorspace)
palette = q.color_histogram.sort {|a, b| b[1] <=> a[1]}
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "rr2014"
config.vm.box_url = "https://s3.amazonaws.com/kshaver-resources/rr2014.box"
@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.
@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
* {
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
}
::-moz-selection {
background:#444;
color:#fff;
text-shadow:none;
>form action="/users" method="post">
<input type="hidden" name="is_guest_account" value="true">
<input type="submit" value="Try it!">
</fprm>
@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 */
@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;