Skip to content

Instantly share code, notes, and snippets.

caseywatts /
Last active May 1, 2019
heroku flip bookmarklet

UPDATE: just use this plugin lol

To run a single test or category of tests in ember-mocha, you sometimes put .only() after your it or describe or context. But if this gets accidentally checked into the repository, the testing suite will erroneously pass for failures in any other test O_O.

This would be better as a jscs or eslint plugin - probably in ember-suave (which is migrating jscs to eslint right now). But short-term, this helps :)

caseywatts /
Last active Jun 10, 2017

Short link to this page:

Other gists & tricks:

Open Current Image in Pixlr Express

This bookmarklet is good for quickly modifying an image, such as overlaying some text.

  1. Save this bookmarklet. Right-click on boomarks toolbar Add Page...
  • Name: pixlr or whatever you'd like (maybe short so it stays on your bookmarks toolbar)
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
View fizzbuzz.rb
def fizzbuzz(x)
# your
# code
# goes
# here
puts "(change me I am a placeholder string)"
View Cloud 9 Static Content

Cloud 9 - Static Content

Setting Up Cloud9

  • Go to and log in
  • Create a new workspace
    • Workspace name = practice-static-site
    • Clone from Git or Mercurial URL =
    • (everything else at defaults)

Look around

caseywatts / Gemfile
Last active Feb 19, 2020
Sinatra on Cloud9
View Gemfile
source ''
gem 'sinatra'
gem 'sinatra-contrib'
caseywatts /
Last active Jun 8, 2016
Nokogiri on OS X 10.10, Nov 2015
gem install nokogiri -v '' -- --use-system-libraries --with-xslt-dir=/usr/local/opt/libxslt --with-iconv-dir=/usr/local/opt/libiconv --with-xml2-dir=/usr/local/opt/libxml2 --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xml2-include=/usr/local/opt/libxml2/include/libxml2 --with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config
gem install nokogumbo -v '1.4.1' -- --use-system-libraries --with-xslt-dir=/usr/local/opt/libxslt --with-iconv-dir=/usr/local/opt/libiconv --with-xml2-dir=/usr/local/opt/libxml2 --with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config --with-xml2-include=/usr/local/opt/libxml2/include/libxml2 --with-xslt-config=/usr/local/opt/libxslt/bin/xslt-config
caseywatts / svg_to_png.js
Last active May 3, 2016
convert svg to png inline
View svg_to_png.js
// modified from answers on
// Takes an SVG element as target
function svg_to_png_data(target) {
var ctx, mycanvas, svg_data, img, child;
// Construct an SVG image
var new_width = target.width.baseVal.valueInSpecifiedUnits;
var new_height = target.height.baseVal.valueInSpecifiedUnits;