Skip to content

Instantly share code, notes, and snippets.

@caseywatts
caseywatts / 0.md
Last active May 1, 2019
heroku flip bookmarklet
View 0.md
View ember-test-are-any-only-present.md

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
caseywatts / OpenCurrentImageInPixlrExpress.md
Last active Jun 10, 2017
OpenCurrentImageInPixlrExpress
View OpenCurrentImageInPixlrExpress.md

Short link to this page: http://caseywatts.com/pixlr

Other gists & tricks: http://caseywatts.com/gists-and-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 MediawikionHeroku.md
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)"
end
View Cloud 9 Static Content README.md

Cloud 9 - Static Content

Setting Up Cloud9

  • Go to c9.io and log in
  • Create a new workspace
    • Workspace name = practice-static-site
    • Clone from Git or Mercurial URL = https://gist.github.com/f4f1dc512ffdce293aa1.git
    • (everything else at defaults)

Look around

@caseywatts
caseywatts / Gemfile
Last active Feb 19, 2020
Sinatra on Cloud9
View Gemfile
source 'https://rubygems.org'
gem 'sinatra'
gem 'sinatra-contrib'
@caseywatts
caseywatts / InstallNokogiriPlease.sh
Last active Jun 8, 2016
Nokogiri on OS X 10.10, Nov 2015
View InstallNokogiriPlease.sh
gem install nokogiri -v '1.6.6.2' -- --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
caseywatts / svg_to_png.js
Last active May 3, 2016
convert svg to png inline
View svg_to_png.js
// modified from answers on http://stackoverflow.com/questions/5433806/convert-embedded-svg-to-png-in-place
// 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;