Skip to content

Instantly share code, notes, and snippets.

View yo
0x94b830d74b649bbe82c44ba13201db4b63703f0f
View Rinkeyby
0xcd480AcE2ab78C48131BE418eCad556EEC56741e
View Rinkeby
0x93DD32a66BCFF2ccBC6F95336cAc34c242857402
@pheuter
pheuter / gist:7d37a6f011c0aa786912
Created Jan 8, 2016
On why the team is moving forward with the ava test runner over mocha
View gist:7d37a6f011c0aa786912
mark
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.
[11:46]
honestly, both tools are close, and i just picked one i feel can service us more with the bleeding edge environment we’re on
[11:46]
@pheuter
pheuter / gist:9b108bd425cd9d405308
Created Aug 13, 2014
Rick Ross image scraper using Nokogiri (鋸)
View gist:9b108bd425cd9d405308
require 'open-uri'
require 'nokogiri'
i = 0
file = File.new "ross_image_urls.txt", "w"
50.times do
imageUrls = Nokogiri::HTML(open(URI.escape("https://www.google.com/search?q=rick+ross&biw=1301&bih=442&sei=WKvrU9nIJ43gsASAxYHQDQ&tbm=isch&ijn=2&ei=WKvrU9nIJ43gsASAxYHQDQ&start=#{i}"))).css('img').each do |image|
file.puts image['data-src']
end
View keybase.md

Keybase proof

I hereby claim:

  • I am pheuter on github.
  • I am markfayngersh (https://keybase.io/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:

View test.coffee
class A
initialize: ->
@x = 1
a = new A
x: 1
log a
@pheuter
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
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
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 = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
You can’t perform that action at this time.