Skip to content

Instantly share code, notes, and snippets.

View tdelam's full-sized avatar

Trevor Delamorandiere tdelam

View GitHub Profile
/**
3 pillar blocks
*/
#pillars {
float: left;
width: 910px;
padding-left: 40px;
padding-right: 40px;
margin-top: 100px;
}
<%= render :partial => '/refinery/menu',
:locals => {
:dom_id => 'submenu',
:roots => refinery_menu_pages.reject{|p| p.parent_id != @page.root.id },
} %>
@tdelam
tdelam / controller.rb
Created March 15, 2012 14:08 — forked from nicinabox/controller.rb
Setting i18n translations in Refinery
# In a controller
# This is not necessary when using the view code below
::I18n.locale = params[:locale]
# encoding: utf-8
Refinery::I18n.configure do |config|
config.enabled = true
config.default_locale = :en
config.current_locale = :en
config.default_frontend_locale = :en
config.frontend_locales = [:en, :es]
config.locales = {:en=>"English", :es=>"Español"}
end
@tdelam
tdelam / osx_lion_rail_setup.md
Created March 17, 2012 18:01 — forked from jpantuso/osx_lion_rail_setup.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
@tdelam
tdelam / fabfile.py
Created April 20, 2012 15:56 — forked from fiee/fabfile.py
fabric fabfile.py for deployment of django apps on Debian servers
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too
- (void) loginToGateway {
MobileDeviceLoginRequest *mobileDeviceLoginRequest =
[MobileDeviceLoginRequest mobileDeviceLoginRequest];
mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.name = <USERNAME>;
mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.password = <PASSWORD>;
mobileDeviceLoginRequest.anetApiRequest.merchantAuthentication.mobileDeviceId =
[[[UIDevice currentDevice] uniqueIdentifier]
stringByReplacingOccurrencesOfString:@"-" withString:@"_"];
AuthNet *an = [AuthNet getInstance];
-(void)registerDevice
{
MobileDeviceRegistrationRequest *registrationRequest=[MobileDeviceRegistrationRequest mobileDeviceRegistrationRequest];
registrationRequest.anetApiRequest.merchantAuthentication.name=@"loginid";
registrationRequest.anetApiRequest.merchantAuthentication.password = @"password";
registrationRequest.mobileDevice.mobileDescription=@"asd";
registrationRequest.mobileDevice.mobileDeviceId=[[[UIDevice currentDevice] uniqueIdentifier]
# encoding: utf-8
Refinery::I18n.configure do |config|
config.enabled = true
config.default_locale = :en
config.current_locale = :en
config.default_frontend_locale = :en
config.frontend_locales = [:en, :fr]
config.locales = {:en => "English", :fr => "Français"}
end
1.9.3p194 :004 > Refinery::Page.find('contact-us').translations
Refinery::Page Load (0.3ms) SELECT "refinery_pages".* FROM "refinery_pages" WHERE "refinery_pages"."slug" = 'contact-us' LIMIT 1
Refinery::Page::Translation Load (0.2ms) SELECT "refinery_page_translations".* FROM "refinery_page_translations" WHERE "refinery_page_translations"."refinery_page_id" = 10
=> [#<Refinery::Page::Translation id: 16, refinery_page_id: 10, locale: "en", title: "Contact Us", custom_slug: nil, menu_title: "Contact Us", slug: "contact-us", created_at: "2012-08-14 17:25:36", updated_at: "2012-08-14 20:37:47">]