Skip to content

Instantly share code, notes, and snippets.

View Rakefile
ssh_user = "" # for rsync deployment
remote_root = "~/path/to/remote/" # for rsync deployment
namespace :styles do
desc "Clear styles"
task :clear do
puts "*** Clearing styles ***"
system "rm -Rfv css/*"
desc "Generate styles"
daz / php-cgi.rb
Created Sep 24, 2011 — forked from ambethia/php-cgi.rb
Homebrew Formula for PHP 5.2.17 as php-cgi (for nginx, etc.)
View php-cgi.rb
# Homebrew Formula for PHP 5.2.17 as php-cgi (for nginx, etc.)
require 'formula'
class PhpCgi <Formula
daz / style.scss
Last active Mar 2, 2021 — forked from kevindavis/gist:1868651
Bootstrap styling for jQuery UI autocomplete
View style.scss
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;
View gist:4959756
def display_address_title(employee)
if employee.address.empty?
daz / go.xero.js
Last active Dec 17, 2015 — forked from ash37/go.xero
View go.xero.js
// keymaster.js
// (c) 2011-2012 Thomas Fuchs
// keymaster.js may be freely distributed under the MIT license.
(function(e){function f(e,t){var n=e.length;while(n--)if(e[n]===t)return n;return-1}function l(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function h(e){for(t in r)r[t]=e[c[t]]}function p(e,t){var i,o,u,l,c;i=e.keyCode,f(a,i)==-1&&a.push(i);if(i==93||i==224)i=91;if(i in r){r[i]=!0;for(u in s)s[u]==i&&(m[u]=!0);return}h(e);if(!,e))return;if(!(i in n))return;for(l=0;l<n[i].length;l++){o=n[i][l];if(o.scope==t||o.scope=="all"){c=o.mods.length>0;for(u in r)if(!r[u]&&f(o.mods,+u)>-1||r[u]&&f(o.mods,+u)==-1)c=!1;(o.mods.length==0&&!r[16]&&!r[18]&&!r[17]&&!r[91]||c)&&o.method(e,o)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function d(e){var t=e.keyCode,n,i=f(a,t);i>=0&&a.splice(i,1);if(t==93||t==224)t=91;if(t in r){r[t]=!1;for(n in s)
View user.rb
# Because we have some old legacy users in the database, we need to
# override #has_secure_passwords' method for checking if a password is valid.
# We first ask if the password is valid, and if it throws an InvalidHash
# exception, we know that we're dealing with a legacy user, so we check the
# password against the SHA1 algorithm that was used to hash the password in
# the old database.
View Google Apps .zone File
calendar 1 IN CNAME
drive 1 IN CNAME
mail 1 IN CNAME
sites 1 IN CNAME
video 1 IN CNAME
; MX
@ 1 IN MX 10
@ 1 IN MX 1

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain

View geo_world_map_migration.rb
class CreatePlaces < ActiveRecord::Migration
# Rails migration for GeoWorldMap db into postgresql db
# (inspired by post)
# extract files from archive from here
# and place them into #{Rails.root}/db/migrate/
# the archive has 'cities.txt' file, rename it 'Cities.txt'
daz /
Created May 8, 2016
Build last stable version of ZSH from sources on Ubuntu, or any other version with small changes
# Build Zsh from sources on Ubuntu.
# From and sources INSTALL file.
# Make script gives up on any error
set -e
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo checkinstall