Skip to content

Instantly share code, notes, and snippets.

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

Chris Ruppel rupl

💭
¯\_(ツ)_/¯
View GitHub Profile
@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 / .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 / 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)
@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: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 / 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;
}
//
// All lines starting with "//" will not show up in the style.css
// However, the following lines inside "/* ... */" WILL show up.
//
// The visible comment below is there to warn any developer who
// opens a .css file that they need to edit the .scss versions ONLY.
// But you already know that because you're reading this :)
//
/*
// Same as rgba(), in fact, browsers re-map hsla() to rgba() internally,
// except IE9 who retains it as hsla
Modernizr.addTest('hsla', function() {
setCss('background-color:hsla(120,40%,100%,.5)');
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
});
// SASS
.header-main ul.inline li {
& a:hover {
background-color: $dkblue;
}
&.active-trail a {
background-color: $dkblue;
}
}
@rupl
rupl / gist:2507359
Created April 27, 2012 08:16 — forked from webchick/gist:2503918
Only bluecheese errors.
Warning: Illegal offset type in unset in drupal_get_messages() (line 1791 of /var/www/git-dev.drupal.org/htdocs/includes/bootstrap.inc).
Warning: Illegal offset type in isset or empty in drupal_get_messages() (line 1793 of /var/www/git-dev.drupal.org/htdocs/includes/bootstrap.inc).
Notice: Undefined variable: search_box in include() (line 21 of /var/www/git-dev.drupal.org/htdocs/sites/all/themes/bluecheese/tpl/page.tpl.php).