Skip to content

Instantly share code, notes, and snippets.

View ioptics's full-sized avatar

Peter Lambert ioptics

  • Takeform Studios
  • London, UK
View GitHub Profile
@ioptics
ioptics / gist:4962287471afcdf5eab8
Created January 30, 2015 16:42
Background image test
<script type="text/javascript">
var header_path = '//s.wldcdn.net/media/cougardate/header';
if (WLD && WLD.Member) {
document.write(
'<img src="//s.wldcdn.net/media/cougardate/' + (WLD.Member.split == 'odd' ? 'header' :'header1') + '.png" style="display: block;">'
+ '<style type="text/css">'
+ 'body{background:url(//s.wldcdn.net/media/cougardate/' + (WLD.Member.split == 'odd' ? 'old-bg.png' :'main-bg1.jpg') + ')}'
+ '</style>'
);
login: &login
adapter: mysql
host: localhost
username: root
development:
<<: *login
database: db_development
test:
@ioptics
ioptics / key_events.txt
Created December 12, 2009 12:39
List of key codes
Javascript Key Codes
Key Pressed Key Code
backspace 8
tab 9
enter 13
shift 16
ctrl 17
alt 18
pause/break 19
# Plugins
plugin 'haml', :git => "git://github.com/nex3/haml.git"
plugin 'factory_girl', :git => "git://github.com/thoughtbot/factory_girl.git"
plugin 'paperclip', :git => "git://github.com/thoughtbot/paperclip.git"
plugin 'paperclippolymorph', :git => "git://github.com/heavysixer/paperclippolymorph.git"
plugin 'make_resourceful', :git => "git://github.com/hcatlin/make_resourceful.git"
# Gems
gem 'thoughtbot-shoulda', :source => "http://gems.github.com"
# we want /posts, /posts/published, /posts/drafts, etc. without too much duplication
# model
class Post < ActiveRecord::Base
named_scope :published, lambda {{:conditions => ...}}
named_scope :draft, lambda {{:conditions => ...}}
named_scope :expired, lambda {{:conditions => ...}}
named_scope :upcoming, lambda {{:conditions => ...}}
end