Skip to content

Instantly share code, notes, and snippets.

- unless @confirmation_code.nil?
- form_for(:game_citizen, :url => confirm_game_citizen_path(@game_citizen)) do |f|
%p
= f.hidden_field(:confirmation_code, :value => @confirmation_code)
= f.submit('Confirm my account!')
- if current_user
- if current_user.staff?
.admin.panel
%p= link_to('Create Blog post', new_entry_path)
%p= link_to('Create Page', new_page_path)
.blog
#title
- unless entry_form.heading_image.nil? || !File.exist?(entry_form.heading_image.asset.path(:headline))
= image_tag(entry_form.heading_image.asset.url(:headline))
- else
= image_tag('headline_blank.png')
.image_upload
.threecolumn.noborder
- form_for(image_form, :url => assets_path, :html => {:enctype => 'multipart/form-data', :id => 'headline_image_form'}) do |f|
@fidothe
fidothe / mocha.rb
Created May 12, 2009 10:26 — forked from drnic/mocha.rb
# For mocha integration, add this file into features/support folder
require "mocha"
World(Mocha::Standalone)
Before do
mocha_setup
end
<!--: spam
Content-Type: text/html
<body><font style="color: white; font-size: 1px"> -->
<body><font style="color: white; font-size: 1px"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>
<div class="cgitb">
<script type="text/javascript">
function toggleDebugInfo() {
#!/bin/sh
sudo mkdir -p /usr/local/hudson
sudo curl -k -L http://hudson.gotdns.com/latest/hudson.war -o /usr/local/hudson/hudson.war
gad:~ matt$ rvm jruby@culerity -e "puts 'hello world'"
info: jruby-1.5.1: jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [x86_64-java]
hello world
gad:~ matt$
gad:~ matt$ ruby -e "puts 'hello world'"
hello world
gad:~ matt$
$ cucumber # (culerity harness) ->
system "cucumber" # (culerity generated test app) ->
"rvm jruby@culerity ruby /path/to/script/to/start/celerity.rb" # eventual celerity invocation
@fidothe
fidothe / gist:894327
Created March 30, 2011 12:49
If you want to use gem pristine with RVM gemsets after ditching MacPorts for Homebrew to recompile native gems:
# If you want to use gem pristine with RVM gemsets after ditching MacPorts for Homebrew
# in order to recompile native gems you need to exclude things in the global gemset
# probably rake, bundler, maybe rdoc
gem list --no-versions | grep -v bundler | grep -v rake | xargs -n1 gem pristine
@fidothe
fidothe / bundle-all
Created May 3, 2011 10:28
run git pull / push / status in all child folders which are git repositories; run bundle install in all child folders which have Gemfiles
#!/bin/bash
for i in `find . -name Gemfile -depth 2 | xargs -n1 dirname`
do
pushd $i
bundle install
popd
done
@fidothe
fidothe / cookieblind.rb
Created May 4, 2011 13:54
Rack middleware to prevent cookies coming in or out except on POST
class Cookieblind
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
unless request.post?
env.delete("HTTP_COOKIE")
end