Skip to content

Instantly share code, notes, and snippets.

@ArthurN
ArthurN / installation.sh
Last active July 2, 2020 07:29
From pow to puma-dev on macOS keeping .dev domains
# Why:
# 1) Chrome 63 (Dec 8) breaks .dev domains by forcing HTTPS: https://ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts/
# 2) Pow is at EOL, superceded by puma-dev (see http://pow.cx/manual, 6 Version History, 0.6.0, Dec 8 2017)
# Uninstall pow
curl get.pow.cx/uninstall.sh | sh
# If you use powder, you can remove it as well
gem uninstall powder
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@nbibler
nbibler / gist:5307941
Last active October 7, 2021 09:38
A .powrc file which works with RVM's .rvmrc or .ruby-version (+ .ruby-gemset) configuration files.
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
# put this at ~/.gitconfig
[alias]
# I'm lazy, so two letters will always trump the full command
co = checkout
ci = commit
cp = cherry-pick
st = status
br = branch
@jpmckinney
jpmckinney / tz_identifiers_to_rails_identifiers.rb
Created January 5, 2011 21:44
Maps tz database time zone identifiers to Rails time zone identifiers
# blog post: http://blog.slashpoundbang.com/post/2613268281/changing-from-tz-database-identifiers-to-rails-friendly
{
"Australia/Adelaide" => "Adelaide",
"Australia/Broken_Hill" => "Adelaide",
"America/Anchorage" => "Alaska",
"America/Juneau" => "Alaska",
"America/Nome" => "Alaska",
"America/Yakutat" => "Alaska",
"Pacific/Gambier" => "Alaska",
"Asia/Almaty" => "Almaty",
// Handles JavaScript history management and callbacks. To use, register a
// regexp that matches the history hash with its corresponding callback.
window.HashHistory = {
// The interval at which the window location is polled.
URL_CHECK_INTERVAL : 500,
// We need to use an iFrame to save history if we're in an old version of IE.
USE_IFRAME : jQuery.browser.msie && jQuery.browser.version < 8,
class User < ActiveRecord::Base
# gradual engagement is needed, to allow admin creation of users
# users should create authorization data only when they need to
# access some system feature that requires authentication
# So ... our gradual engagement scheme for authlogic:
# 1. admin creates user, setting only name and phone number (required)
# admin may set email address (optional)
# 2. user is sent email invitation with link to activate their account
# admin can re-send email at user's request
# 3. user sets login and password/password_confirmation using activation form