Skip to content

Instantly share code, notes, and snippets.

View randomm's full-sized avatar

Janni Turunen randomm

  • Helsinki
View GitHub Profile
// jQuery no-double-tap-zoom plugin
// Triple-licensed: Public Domain, MIT and WTFPL license - share and enjoy!
(function($) {
var IS_IOS = /iphone|ipad/i.test(navigator.userAgent);
$.fn.nodoubletapzoom = function() {
if (IS_IOS)
$(this).bind('touchstart', function preventZoom(e) {
var t2 = e.timeStamp
@eprothro
eprothro / octopus.rb
Last active December 16, 2015 04:08
Octopus initializer for use with master/slave horizontal DB scaling with a Rails application on the Heroku stack. See the wiki page for more info: https://github.com/tchandy/octopus/wiki/Replication-with-Rails-on-Heroku
module Octopus
def self.shards_in(group=nil)
config[Rails.env].try(:[], group.to_s).try(:keys)
end
def self.followers
shards_in(:followers)
end
class << self
alias_method :followers_in, :shards_in
alias_method :slaves_in, :shards_in
@tashian
tashian / circle.yml
Last active August 24, 2017 07:47
Rails/Heroku CircleCI deploy script
checkout:
post:
- git submodule sync
- git submodule update --init # use submodules
deployment:
production:
branch: production
commands:
- ./bin/heroku_deploy.sh yerdle:
timeout: 300