Skip to content

Instantly share code, notes, and snippets.

View yo
View Rinkeyby
View Rinkeby
pheuter / gist:7d37a6f011c0aa786912
Created Jan 8, 2016
On why the team is moving forward with the ava test runner over mocha
View gist:7d37a6f011c0aa786912
Jan 8, 2016
[11:45 AM]
yeah, and then i realized im thinking too much about it, and i went with the faster tool whose assertion syntax covers everything our tests use so far and is a relatively simple port over.
honestly, both tools are close, and i just picked one i feel can service us more with the bleeding edge environment we’re on
pheuter / gist:9b108bd425cd9d405308
Created Aug 13, 2014
Rick Ross image scraper using Nokogiri (鋸)
View gist:9b108bd425cd9d405308
require 'open-uri'
require 'nokogiri'
i = 0
file = "ross_image_urls.txt", "w"
50.times do
imageUrls = Nokogiri::HTML(open(URI.escape("{i}"))).css('img').each do |image|
file.puts image['data-src']

Keybase proof

I hereby claim:

  • I am pheuter on github.
  • I am markfayngersh ( on keybase.
  • I have a public key whose fingerprint is 57E0 005D 96B5 5B63 C102 899A 6F7F 5E37 2A2F ED01

To claim this, I am signing this object:

class A
initialize: ->
@x = 1
a = new A
x: 1
log a
pheuter / test.js
Created Nov 21, 2012
backbone.computedfields marionette.collectionview unit test
View test.js
describe('when ComputedFields initialized in Backbone.Model via Marionette.CollectionView', function () {
var model, collection, collectionView;
beforeEach(function () {
var Model = Backbone.Model.extend({
initialize: function () {
this.computedFields = new Backbone.ComputedFields(this);
pheuter / gist:3515945
Created Aug 29, 2012
Handlebars.js equality check in #if conditional
View gist:3515945

Handlebars.js is a template framework for Javascript environments. It allows the construction of HTML elements using HTML and expressions wrapped in {{ }}

Limitations of {{if}}

One of the conditional block helpers Handlebars offers is the {{#if}}.

For example:

<div class="entry">
pheuter / sc-dl.js
Created Mar 5, 2012
Bookmarklet that generates download link for a Soundcloud upload
View sc-dl.js
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = ""+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl); = '10px'; = 'red'; = 700;
You can’t perform that action at this time.