Skip to content

Instantly share code, notes, and snippets.

@hadees
hadees / gist:7308571
Last active December 27, 2015 10:09 — forked from ericboehs/gist:7125105
Poltergeist hack to silence CoreText performance notes from phantomjs that works with billy.
module Capybara::Poltergeist
class Client
private
def redirect_stdout
prev = STDOUT.dup
prev.autoclose = false
$stdout = @write_io
STDOUT.reopen(@write_io)
prev = STDERR.dup
@hadees
hadees / wkhtmltopdf.rb
Last active December 28, 2015 20:29 — forked from 2bits/wkhtmltopdf.rb
Updating QT url
require 'formula'
class WkhtmltopdfQt < Formula
url 'https://qt.gitorious.org/qt/antializes-qt/archive/master.tar.gz'
end
class Wkhtmltopdf < Formula
homepage 'http://code.google.com/p/wkhtmltopdf/'
url 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1.tar.bz2'
sha1 'db03922d281856e503b3d562614e3936285728c7'
@hadees
hadees / git-pivotal
Last active December 30, 2015 10:09 — forked from jondkinney/pivotal_tracker_git_flow.rake
Yet another attempt at Git and Pivotal integration. The twist with this one though is an attempt to work with git-flow. This was inspired by this blog post: http://pivotallabs.com/level-up-your-development-workflow-with-github-pivotal-tracker/ It'll also require https://github.com/petervanderdoes/gitflow once I write the hook.
#!/usr/bin/env ruby
# gem 'pivotal-tracker'
require 'pivotal-tracker'
TRACKER_TOKEN = `git config --get pivotal.token`
TRACKER_PROJECT_ID = `git config --get pivotal.project-id`
PivotalTracker::Client.token = TRACKER_TOKEN
PivotalTracker::Client.use_ssl = true
@hadees
hadees / gist:8225808
Last active January 2, 2016 00:49 — forked from kdisneur/gist:2337544
number_letters = [
:first, :second, :third, :fourth, :fifth, :sixth, :seventh, :eighth, :ninth,
:tenth, :eleventh, :twelfth, :thirteenth, :fourteenth, :fifteenth, :sixteenth, :seventeenth, :eighteenth, :nineteenth,
:twentieth, :twenty_first, :twenty_second, :twenty_third, :twenty_fourth, :twenty_fifth, :twenty_sixth, :twenty_seventh, :twenty_eighth, :twenty_ninth,
:thirtieth, :thirty_first, :thirty_second, :thirty_third, :thirty_fourth, :thirty_fifth, :thirty_sixth, :thirty_seventh, :thirty_eighth, :thirty_ninth,
:fortieth, :fourty_first, :fourty_second, :fourty_third, :fourty_fourth, :fourty_fifth, :fourty_sixth, :fourty_seventh, :fourty_eighth, :fourty_ninth,
:fiftieth, :fifty_first, :fifty_second, :fifty_third, :fifty_fourth, :fifty_fifth, :fifty_sixth, :fifty_seventh, :fifty_eighth, :fifty_ninth,
:sixtieth, :sixty_first, :sixty_second, :sixty_third, :sixty_fourth, :sixty_fifth, :sixty_sixth, :sixty_seventh, :sixty_eighth, :sixty_ninth,
:seventieth, :seventy_first, :seventy_second, :sevent
$(document).ready(function() {
if(window.self !== window.top) {
var currentHeight = document.body.clientHeight;
var resizeIframeTracker = setInterval(function() {
var height = document.body.clientHeight;
if(currentHeight !== height) {
message = JSON.stringify({"frameHeight": height})
window.parent.postMessage(message, "*");
currentHeight = height;
}
$(document).ready(function() {
if(window.self !== window.top) {
var padding = 200;
var currentHeight = window.ApplicationHelpers.pageHeight() + padding;
var resizeIframeTracker = setInterval(function() {
$(document).ready(function() {
var height = window.ApplicationHelpers.pageHeight() + padding;
if(currentHeight !== height) {
message = JSON.stringify({"frameHeight": height});
window.parent.postMessage(message, "*");
$ youtube-dl --autonumber-size 3 --restrict-filenames -o "S01E%(autonumber)s-%(title)s.%(ext)s" --playlist-reverse https://www.youtube.com/playlist?list=PLE7j5FieXSTc-2gbs7NkrDPhkS_rQS9XT
@hadees
hadees / model.rb
Created September 20, 2016 01:44
Model Template
<% module_namespacing do -%>
class <%= class_name %> < <%= parent_class_name.classify %>
### Default Scope
### Includes and Extensions
### Constants
### Virtual attributes
class BooleanValue
# https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/column.rb#L8
FALSE_VALUES = [false, 0, "0", "f", "F", "false", "FALSE", "off", "OFF"]
def self.convert(value)
Rails.present? ? with_rails(value) : without_rails(value)
end
private

Keybase proof

I hereby claim:

  • I am hadees on github.
  • I am hadees (https://keybase.io/hadees) on keybase.
  • I have a public key whose fingerprint is A0C1 850A 15D1 1F77 DA03 94F3 367E 21AD A895 8278

To claim this, I am signing this object: