Skip to content

Instantly share code, notes, and snippets.

body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
#!/usr/bin/env ruby
# coding: utf-8
require "mycmd"
require "csv"
class Zipdb
def initialize(db, table, csv)
@client = Mycmd::Configuration.connect
@db = db
# Twilio HTTP HAProxy Configuration
# Version: 0.1
global
daemon
log 127.0.0.1 local0 info
maxconn 60000
spread-checks 3
#!/bin/sh
rsync="/usr/bin/rsync"
################################
# VARIABLES
################################
# General Variables
remote_server="yourserver.com"
remote_port="22"
namespace :deploy do
desc "Hot-reload God configuration for the Resque worker"
task :reload_god_config do
sudo "god stop resque"
sudo "god load #{File.join(deploy_to, 'current', 'config', 'resque-' + rails_env + '.god')}"
sudo "god start resque"
end
end
# append to the bottom:
# An abstract base class used to create simple serializers
# for ActiveRecord objects
class BaseSerializer
include Rails.application.routes.url_helpers
attr_reader :serialized_object
def initialize(serialized_object)
@serialized_object = serialized_object
end
OmniAuth.config.on_failure = -> env do
env[ActionDispatch::Flash::KEY] ||= ActionDispatch::Flash::FlashHash.new
env[ActionDispatch::Flash::KEY][:error] = "Either your email or password was not recognised. Please try again."
SessionsController.action(:new).call(env) #call whatever controller/action that displays your signup form
end
/*!
* William DURAND <[email protected]>
* MIT Licensed
*
* Usage:
*
* $('.photos').flickrPhotoStream({ id: '12345' });
*
* $('.photos').flickrPhotoStream({
* id: '12345', // Flickr PhotoStream Set ID