Skip to content

Instantly share code, notes, and snippets.

View adam's full-sized avatar

Adam French adam

View GitHub Profile
module Authorization
module User
# include ::DataMapper::Resource
# This is a "vanity" relationship. A user may not have all permissions for an entire role,
# but still may be said to be a member of the role.
# has_and_belongs_to_many :roles
has 1.0/0, :roles, :through => ::DataMapper::Resource
# This relationship contains the actual list of permissions the user has been granted.
has 1.0/0, :permissions, :through => ::DataMapper::Resource
# this demonstrates using dm-fauxtures to fill an ticketing systems database with fixtures.
# invoke by using `rake app:setup`
namespace :app do
desc 'setup'
task :setup => ['dm:db:automigrate', 'app:create_base_users', 'app:create_base_projects']
task :create_base_users => :merb_env do
User.create(
:login => 'admin',
namespace :app do
desc 'setup'
task :setup => ['dm:db:automigrate', 'app:create_base_users', 'app:create_base_projects']
task :create_base_users => :merb_env do
User.create(
:login => 'admin',
:email => 'adam@wieck.com',
:password => 'sekrit',
:password_confirmation => 'sekrit',
porter:src afrench$ sudo gem install merb -v0.9.3
ERROR: Error installing merb:
merb-action-args requires merb-core (>= 0.9.5, runtime)
Promises of Obama/Biden Ticket
as per DNC Nomination Acceptance Speech By Obama
28 aug 2008
---
rewards for small business owners
tax breaks for companies which offer jobs in the US
no capital gains tax for start-ups and young business
cut taxes for 95% of all working families
set clear 10-year goal for ending oil/gas international dependance
tap national gas reserves
class Event
include DataMapper::Resource
property :id, Serial
property :name, String
has n, :participations, :order => [:position.asc] # <<<<<<<<<
has n, :clients, :through => :participations
end
#!/usr/bin/env ruby
require 'rubygems'
require 'uri'
require 'open-uri'
require 'hpricot'
require 'net/http'
require 'ftools'
## it's pretty disgusting that that I require this many things. Someone fork me and fix me.
./configure --with-openssl=/opt/csw --with-jpeg-dir=/opt/csw --enable-bcmath=shared --with-bz2=shared,/opt/csw --enable-calendar=shared --enable-ctype=shared --with-curl=shared,/opt/csw --with-curlwrappers --enable-dba --with-gdbm=/opt/csw --with-db4=/opt/csw/bdb44 --enable-dbase=shared --enable-dom=shared --with-libxml-dir=/opt/csw --enable-exif=shared --enable-filter=shared --with-pcre-dir=/opt/csw --enable-ftp=shared --with-gd=shared,/opt/csw --with-png-dir=/opt/csw --with-zlib-dir=/opt/csw --with-xpm-dir=/opt/csw --with-ttf=/opt/csw --with-freetype-dir=/opt/csw --with-t1lib=/opt/csw --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext=shared,/opt/csw --with-gmp=shared,/opt/csw --enable-hash=shared --with-iconv=shared --with-iconv-dir=/opt/csw --with-imap=shared,/opt/csw --with-kerberos=/opt/csw --with-imap-ssl=/opt/csw --enable-json=shared --with-ldap=shared,/opt/csw --with-ldap-sasl=/opt/csw --enable-mbstring=shared --enable-mbregex=shared --with-mcrypt=shared,/opt/csw --with-mhash=shared,/opt/csw
$(document).ready(function() {
if (window.location.search.length > 0) {
// crunch the window.location.search to pull the query value
var parsedQuery = jQuery.map(window.location.search.replace('?', '').split("&"), function(val, i){return [val.split('=')[0], val.split('=')[1]]});
var queryValue = parsedQuery[parsedQuery.indexOf('query') + 1].replace('+', ' ');
if (queryValue && queryValue != null && queryValue != '') {
$('.search form input[type=text]').val(queryValue);
$('.search form input[type=text]').attr('original_value', queryValue);
GIVEN THAT
'honda-releases-accord-2011' IS NOT claimed
Action is INSERT
WHEN
a_release.requested_slug = 'honda-releases-accord-2011'
THEN
a_release.persisted_slug = 'honda-releases-accord-2011'
GIVEN THAT