Skip to content

Instantly share code, notes, and snippets.

View caseywatts's full-sized avatar
Hi, I’m Casey!

Casey Watts caseywatts

Hi, I’m Casey!
View GitHub Profile
@caseywatts
caseywatts / fizzbuzz.rb
Last active February 28, 2016 18:09
Fizzbuzz
def fizzbuzz(x)
# your
# code
# goes
# here
puts "(change me I am a placeholder string)"
end
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@caseywatts
caseywatts / svg_to_png.js
Last active May 3, 2016 13:03
convert svg to png inline
// 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;
@caseywatts
caseywatts / InstallNokogiriPlease.sh
Last active June 8, 2016 22:34
Nokogiri on OS X 10.10, Nov 2015
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 / Cloud 9 Static Content README.md
Last active November 1, 2016 17:37
Cloud 9 - Static Content

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 / meetup site jekyll.md
Last active November 1, 2016 17:39
How To: Tech Meetup Jekyll Site

How to make a meetup site quickly

Set up Jekyll

If you haven't before, make your own Jekyll site first to understand how it works and what the pieces are. Last time I made one, this is what I had to do:

Install Jekyll

gem install jekyll
jekyll new
@caseywatts
caseywatts / stubbing-relationships-ember.md
Last active January 18, 2017 16:52
Stubbing Relationships in Model Unit Tests
UPDATE: Actually, doing this with `reopen` is apparently deprecated. Back to creating actual objects for relationships -_-
don't do this below stuff

Stubbing relationships in model unit tests

// model
export default DS.Model.extend({
@caseywatts
caseywatts / listenonrepeat.md
Created March 13, 2017 19:12
Listen on Repeat

This bookmarklet takes you from a youtube video page to the listenonrepeat page for that video

  1. Save this bookmarklet. Right-click on boomarks toolbar Add Page...
  • Name: yt∞ or whatever you'd like (maybe short so it stays on your bookmarks toolbar)
  • URL: javascript:(document.location.href = document.location.href.replace('youtube.com', 'listenonrepeat.com'))();
  1. When on a youtube video page, click this bookmarklet to be taken to the listenonrepeat page 🎉
@caseywatts
caseywatts / gist:6cf9391e7ddd25a331dafbed5cee8a8e
Created March 27, 2017 05:19
Steam + Controller on OSX via Wine
  • brew install Caskroom/cask/wineskin-winery
  • Open app "Wineskin Winery"
    • Click "Create New Blank Wrapper" and name it "WindowsSteam"
    • Right click on app "WindowsSteam" and click "show package contents"
    • Open "Wineskin" app that lives inside the "WindowsSteam" app
    • "Advanced"
    • "middle tab"
    • "winetricks"
    • "update winetricks"
  • Install dotnet45
@caseywatts
caseywatts / README.md
Last active June 10, 2017 17:41
Autorefresh Terminal History

Other gists & tricks: http://caseywatts.com/gists-and-tricks

#Autorefresh Terminal History For giving presentations.

I've been trying to find a way to show an audience the recent terminal commands I've been calling. I can easily imagine doing this in a separate terminal window that just auto-refreshes showing the history of commands recently called.

I decided to try a ruby script! (Bash would be fine too, just comfort)

###Obtaining the history