Skip to content

Instantly share code, notes, and snippets.

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

Chris Ruppel rupl

💭
¯\_(ツ)_/¯
View GitHub Profile
@rupl
rupl / saturn.pl
Created May 20, 2015 05:16
ASCII art of Saturn that creates an ASCII animation of Saturn. Original author unknown.
#!/usr/bin/perl
;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;
+$I=sub{+s+^+ ;;;;;;; ;;;;;;;;;
$"x$_[1]+gem;$/x$_# ;;;; ;;;;;;;;
@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 / 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 / user-actions.js
Last active May 11, 2018 22:46
A CasperJS script to demonstrate simple user navigation actions on a website. This sample accompanies a blog post about CasperJS found at http://fourword.fourkitchens.com/article/simulate-user-actions-casperjs
/**
* @file
* Simulating user actions with CasperJS. This script explores the ability to
* use Casper for navigation just like a user would: clicking the page and
* entering text to submit a form. This script accompanies a blog post from
* Four Kitchens:
*
* @see http://fourword.fourkitchens.com/article/simulate-user-actions-casperjs
*/
@rupl
rupl / gulpfile.js
Last active September 25, 2019 15:13
Sample Gulp setup. Watches JS to JSHint, watches two themes for Sass+Compass compilation.
/**
* @file
* Gulpfile that controls frontend development tasks. Just the basics!
*
* Installation: type `npm install` in your console.
* Usage: type `gulp` in your console.
*/
/* jslint node: true */
'use strict';
@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 / 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 / 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 / .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 / 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.