Skip to content

Instantly share code, notes, and snippets.

View baldwindavid's full-sized avatar

David Baldwin baldwindavid

  • Indianapolis, IN
View GitHub Profile
class User < ActiveRecord::Base
belongs_to :plan # or however you get your plan - mine is actually not in an AR model
def can_do_cool_thing?
plan.can_do_cool_thing?
end
def can_do_other_cool_thing?
plan.can_do_other_cool_thing?
@baldwindavid
baldwindavid / personal-to-org-account.md
Created December 12, 2011 21:35
How to turn a personal account into an org account

You can turn your personal account into an organization by going to Account Settings > Organizations, clicking "Turn into an organization", and following the instructions in the pop up dialog.

The history of the account and the repositories will be preserved.

I'll explain each point of the warning you'll get:

You will no longer be able to log into YOURACCOUNT (all administrative privileges will be bestowed upon the organization owners you choose)

This just means that you need to choose a new personal account(s) to add as the owner(s) of your new organization. You need to do that anyway, because you can't log in as an organization. You need to create at least one new personal account for you.

$(function() {
$(".flash").livequery(function(){
$(this).delay(5000).fadeThenSlideToggle();
});
});
{'.' => 1, 'a' => 1.73, 'b' => 1.8, 'c' => 1.51, 'd' => 1.8, 'e' => 1.73, 'f' => 1.05, 'g' => 1.8, 'h' => 1.82, 'i' => 0.78, 'j' => 0.93, 'k' => 1.64, 'l' => 0.78, 'ł' => 0.93, 'm' => 2.73, 'n' => 1.82, 'o' => 1.78, 'p' => 1.8, 'r' => 1.2, 's' => 1.45, 't' => 1.11, 'u' => 1.82, 'w' => 2.91, 'x' => 1.62, 'y' => 1.64, 'z' => 1.45, '0' => 1.78, '1' => 1.78, '2' => 1.78, '3' => 1.78, '4' => 1.78, '5' => 1.78, '6' => 1.78, '7' => 1.78, '8' => 1.78, '9' => 1.78, 'A' => 1.96, 'B' => 1.91, 'C' => 1.96, 'D' => 2.2, 'E' => 1.84, 'F' => 1.71, 'G' => 2.18, 'H' => 2.2, 'I' => 1.22, 'J' => 1.36, 'Ł' => 1.69, 'K' => 1.91, 'L' => 1.63, 'M' => 2.51, 'N' => 2.16, 'O' => 2.31, 'P' => 1.8, 'R' => 2.02, 'S' => 1.82, 'T' => 2.09, 'U' => 2.15, 'W' => 2.93, 'X' => 1.91, 'Y' => 1.89, 'Z' => 1.82, '(' => 1.2, ')' => 1.2, '-' => 1.2, '–' => 1.8, '—' => 2.93, 'nbsp' => 1.11}
module Movable
def is_movable
include InstanceMethods
end
module InstanceMethods
def whereami
"You are here."
end
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :set_counter
helper_method :counter
protected
def counter
@counter
# add a layer of abstraction || obfuscation!
module Somethingable
def self.make(&block)
begin
return true if block.call
rescue
return false
end
end
/* Forms */
form ol {
list-style: none;
margin: 0 0 1em 0;
}
form ol ol { margin-left: 0; }
form ol li { margin: 0 0 1em 0; }
form ol ol li { margin: 0 0 .25em 0; }
<div id="next-prev-link-container">
<a href="/blog/2010/06/13/a-good-time-to-learn.html" target="_blank">Peer Pressure Learning 30 Series</a>
<br />
<small>&larr; <a href="/blog/2010/06/25/ppl30-day-12-factor.html">Day 12: Factor</a></small> - Day 13: DataMapper - <small><a href="/blog/2010/06/27/ppl30-day-14-html5.html">Day 14: HTML5</a> &rarr;</small>
</div>
require 'rubygems'
require 'crack'
require 'httparty'
module Icontact
# http://developer.icontact.com/
# change to your needs
def self.config