Skip to content

Instantly share code, notes, and snippets.

View sstarr's full-sized avatar
🏠
Working from home

Simon Starr sstarr

🏠
Working from home
View GitHub Profile
@alisdair
alisdair / intensify.sh
Created May 21, 2019 23:44
intensifies Slack emoji creator
#!/bin/bash
# Generate a `:something-intensifies:` Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
# Number of frames of shaking
count=10
# Max pixels to move while shaking
@jakebellacera
jakebellacera / floodlight-click-handler.js
Last active June 26, 2019 21:31
Floodlight click handler
document.getElementById("button").addEventListener("click", function(e) {
e.preventDefault();
var url = this.getAttribute("href", 2);
createFloodlightTag("source", "type", "cat", function() {
window.location = url; // Redirect the user after the tag successfully fires
});
});
function createFloodlightTag(source, type, cat, callback) {
@davetron5000
davetron5000 / god.rb
Last active August 29, 2015 14:00
Since we don't need TDD anymore, this is the best way to write tests after you've hand-crafted your code to be beautiful
class God < ActiveRecord::Base
has_many :purchases
has_many :orders
has_many :login_attempts
has_many :friends
acts_as_taggable because: "all tags are the same"
scope :alive, -> { where.not(:status => :dead) }
scope :active, -> { where(:inactive => false) }
@jordelver
jordelver / gist:5998870
Last active January 13, 2017 07:23
Find where stuff broke using git bisect with cucumber

Find where stuff broke using git bisect with Cucumber

Start git bisect

git bisect start

Specify a good and bad commit

git bisect good <commit-where-stuff-is-working>