Skip to content

Instantly share code, notes, and snippets.

View rupl's full-sized avatar
💭
¯\_(ツ)_/¯

Chris Ruppel rupl

💭
¯\_(ツ)_/¯
View GitHub Profile
@rupl
rupl / Custom.css
Last active December 14, 2015 15:38
Some styles to make Google apps match @fourkitchens branding
/* -- Gmail -- */
/* mailbox selector thing */
.W0F9rd,
.J-N-Jz {
color: #28701a !important;
}
/* compose button */
.T-I-KE {
background-image: -webkit-gradient(linear,left top,left bottom,from(#4BaD39),to(#48a136)) !important;
}
@rupl
rupl / gist:5417438
Last active December 16, 2015 10:08
yepnope hackin'
$(function () {
Modernizr.load({
test: Modernizr.json,
nope: ['js/vendor/polyfills/json3.js'],
callback: function() { alert('fires 2nd'));},
complete: function () { alert('fires 1st')); }
});
});
@rupl
rupl / word_count.rb
Last active December 16, 2015 16:40 — forked from chriseppstein/word_count.rb
Word counter for writing articles. Allows you to count lines of code at a different rate than regular words.
#!/usr/bin/env ruby
require 'rubygems'
require 'rdiscount'
require 'nokogiri'
words = 0
limit = 2700
content = $stdin.read
html = RDiscount.new(content).to_html
@rupl
rupl / gist:6392257
Created August 30, 2013 17:24
reproducing differences between phantomjs/netsniff.js + node yslow versus phantomjs/yslow.js
chris-fk [~/src/pjs] 🌟 phantomjs ../phantomjs/examples/netsniff.js http://fourkitchens.com | yslow --format plain -i basic
size: 513.7K (513750 bytes)
overall score: B (89)
url: http://fourkitchens.com/
# of requests: 23
ruleset: ydefault
page load time: 724
chris-fk [~/src/pjs] 🌟 phantomjs yslow.js -i basic -f plain http://fourkitchens.com
size: 623.2K (623245 bytes)

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@rupl
rupl / drupal-test.js
Last active November 18, 2017 23:24
This sample accompanies a blog post series about CasperJS found at http://fourword.fourkitchens.com/article/testing-drupal-casperjs
/**
* @file
* Testing a demo of Drupal. The script will log in and check for various
* features in Drupal core. This demo was inspired by a similar script for
* a Wordpress site. The original script was written by Henrique Vicente.
*
* @see https://github.com/henvic/phantom-casper-simple-talk/blob/master/wordpress.js
*/
// Set up variables to visit a URL and log in.
@rupl
rupl / .zshrc
Last active August 29, 2015 14:02 — forked from SlexAxton/.zshrc
GIF workflow for OS X Mavericks 10.9 and Homebrew 0.9.5 — lovingly adapted from https://gist.github.com/SlexAxton/4989674
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@rupl
rupl / picturefill-test.js
Last active July 4, 2017 10:44
A CasperJS script to test the canonical Picturefill demo. This sample accompanies a blog post series about CasperJS found at http://fourword.fourkitchens.com/article/using-casperjs-test-picturefill
/**
* @file
* Testing to see if Picturefill selects the right source at multiple
* viewport sizes.
*/
// Define the suite of tests and give it the following properties:
// - Title, which shows up before any of the pass/fails.
// - Number of tests, must be changed as you add tests.
// - suite(), which contains all of your tests.
@rupl
rupl / testing-js-code.js
Last active July 4, 2017 10:44
A CasperJS script to test some JavaScript settings on our blog. This sample accompanies a blog post series about CasperJS found at http://fourword.fourkitchens.com/article/testing-js-code-casperjs
/**
* @file
* Using CasperJS to run basic code tests on various libraries.
*/
// Define the suite of tests and give it the following properties:
// - Title, which shows up before any of the pass/fails.
// - Number of tests, must be changed as you add tests.
// - suite(), which contains all of your tests.
//
@rupl
rupl / light_sensor.ino
Last active August 29, 2015 14:03
Modified light sensor tutorials for LilyPad Arduino USB. It only differs in that the LilyPad USB has a different (smaller) set of analog pins, so I used a different address, and increased the delay to a half second so it would be easier to read the numbers. Original tutorial is complements of Leah Buechley, found here: http://web.media.mit.edu/~…
/*
* LilyPad tutorial: sensing (sensors)
*
* Reads data from a LilyPad light sensor module
* and then sends that data to the computer
* so that you can see the sensor values
*
* Original: http://web.media.mit.edu/~leah/LilyPad/08_sensors.html
*/