Skip to content

Instantly share code, notes, and snippets.

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

Chris Ruppel rupl

💭
¯\_(ツ)_/¯
View GitHub Profile

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 / .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 / 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
*/
@rupl
rupl / stuff.scss
Last active August 29, 2015 14:06
Example of Breakpoint Context API making life simpler. Use-case: Singularity.gs — https://github.com/Team-Sass/breakpoint/wiki/Breakpoint-Context
// Define a breakpoint. outputs a media query:
//
// @include breakpoint($wide) {
// stuff
// }
//
// ... becomes ...
//
// @media (min-width: 502px) {
// stuff
@rupl
rupl / eq.scss
Created January 9, 2015 22:55
eq.js nested children of component — right now the problem is the repeating of nested selectors, in this case .thumb
.clip--hero {
margin: 0 auto;
.thumb {
width: 100%;
}
// Leave room for title/desc on desktop.
@include eq('desktop') {
.thumb {
@rupl
rupl / url-shortcuts.txt
Created May 21, 2015 04:52
Using Chrome's custom search engines as shortcuts!
Command | URL | Example | Comment
--------+-----------------------------------------------------------------+---------------------+-------------------
gh | https://github.com/%s | gh rupl/unfold | GitHub repo
npm | https://www.npmjs.com/package/%s | npm gulp-sass | npm module
wpt | http://www.webpagetest.org/?url=%s | wpt example.com | WebPageTest.org
psi | https://developers.google.com/speed/pagespeed/insights/?url=%s | psi example.com | PageSpeed Insights
acme | https://client.atlassian.net/browse/ACME-%s | acme 1234 | Clients' tickets
@rupl
rupl / latest-body-field.sql
Created July 9, 2015 11:52
SQL to extract latest revision of body field out of Drupal 7
SELECT node.title, body.body_value
FROM node
LEFT JOIN node_revision ON node.vid = node_revision.vid
LEFT JOIN field_revision_body AS body ON node_revision.vid = body.revision_id;
-- WHERE node.type = 'whatever'
-- etc
@rupl
rupl / gist:e6db5e3f93ffbddfae6a
Created July 20, 2015 11:43
github 301 redirect for repositories
$ curl -i "https://github.com/team-sass/breakpoint"
HTTP/1.1 301 Moved Permanently
Server: GitHub.com
Date: Mon, 20 Jul 2015 11:42:31 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Status: 301 Moved Permanently
Content-Security-Policy: default-src *; script-src assets-cdn.github.com collector-cdn.github.com; object-src assets-cdn.github.com; style-src 'self' 'unsafe-inline' 'unsafe-eval' assets-cdn.github.com; img-src 'self' data: assets-cdn.github.com identicons.github.com www.google-analytics.com collector.githubapp.com *.githubusercontent.com *.gravatar.com *.wp.com; media-src 'none'; frame-src 'self' render.githubusercontent.com gist.github.com www.youtube.com player.vimeo.com checkout.paypal.com; font-src assets-cdn.github.com; connect-src 'self' live.github.com wss://live.github.com uploads.github.com status.github.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com
Public-Key-Pins: max-age=300; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-s
@rupl
rupl / kitty-resize.jquery.js
Last active August 29, 2015 14:27
Make kitties appear when someone resizes the window
// Paste this into your console to give it a try!
(function($){
$(window).resize(function() {
$('<img src="http://placekitten.com/g/' + (window.innerWidth - 100) + '/' + (window.innerHeight - 100) + '">')
.css({'position': 'absolute', 'top': '50px'})
.appendTo('body');
});
})(jQuery);
@rupl
rupl / wat.html
Created August 5, 2011 17:43 — forked from pifantastic/wat.html
<ul>
<li>1.0
<li>2.0
<ul>
<li>2.1
<li>2.2
^ this would render incorrectly
VS.