Skip to content

Instantly share code, notes, and snippets.

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

Chris Ruppel rupl

💭
¯\_(ツ)_/¯
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / .gitignore
Last active February 12, 2016 07:23
WebDriverCSS + BrowserStack + local server
# Avoid saving full screenshots and failed comparisons, but always save selector-based references.
visual/failed/*
visual/reference/*
!visual/reference/*baseline*
@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);