View git-timestamp.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
#### | |
# based on http://www.clock.co.uk/blog/a-guide-on-how-to-cache-npm-install-with-docker | |
# | |
# Set's the last modified timestamp of a file to it's repositories commit timestamp. | |
# | |
# Particularly useful with docker when building after a new git checkout has been made, | |
# can improve docker build times for composer, bower, npm, etc | |
# | |
# @see https://github.com/docker/docker/issues/3556 |
View helpscout-export.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'helpscout' | |
require 'fileutils' | |
require 'json' | |
api_key = ARGV[0] | |
helpscout = HelpScout::Client.new(api_key) | |
module InstanceVariablesToJson |
View generate-iOS-app-icons.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p generated | |
for size in 29 $((29*2)) $((29*3)) $((40*2)) $((40*3)) 57 $((57*2)) $((60*2)) $((60*3)) 29 $((29*2)) 40 $((40*2)) 50 $((50*2)) 72 $((72*2)) 76 $((76*2)); do | |
sips -Z $size --out generated/$size.png sourceIcon.png | |
done |
View test.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:1d3c9e3602fc6e8e5885
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gist.github.com/sononum/6183139 | |
module Kaminari | |
module ActiveRecordRelationMethods | |
def total_count_with_speed | |
if where_values_hash.empty? | |
sql = "SELECT (reltuples)::integer FROM pg_class r WHERE relkind = 'r' AND relname = #{self.connection.quote table_name}" | |
@_hacked_total_count || (@_hacked_total_count = self.connection.execute(sql).first["reltuples"].to_i) | |
else | |
total_count_without_speed | |
end |
View cloud_app_worker.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'queue_classic' | |
module CloudApp | |
Queue = QC::Queue | |
FailedQueue = QC::Queue.new 'queue_classic_failed_jobs' | |
class Worker < QC::Worker | |
def handle_failure(job, exception) | |
FailedQueue.enqueue job |
View install-graphite-ubuntu-10.04.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################### | |
# BASIC REQUIREMENTS | |
# http://graphite.wikidot.com/installation | |
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/ | |
# Last tested & updated 10/13/2011 | |
#################################### | |
sudo apt-get update | |
sudo apt-get -y upgrade |
View sphinx-beta.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class SphinxBeta < Formula | |
url 'http://sphinxsearch.com/files/sphinx-1.10-beta.tar.gz' | |
homepage 'http://www.sphinxsearch.com' | |
md5 '5b52ce9e93a73c66d37bc3a2402f14fa' | |
head 'http://sphinxsearch.googlecode.com/svn/trunk/' | |
def install | |
fails_with_llvm "fails with: ld: rel32 out of range in _GetPrivateProfileString from /usr/lib/libodbc.a(SQLGetPrivateProfileString.o)" |