Skip to content

Instantly share code, notes, and snippets.

View ryan-allen's full-sized avatar
🐢
Turtles

Ryan Allen ryan-allen

🐢
Turtles
View GitHub Profile
@ryan-allen
ryan-allen / gist:7230
Created August 26, 2008 07:43 — forked from adzap/gist:7229
~. ..~..
/´¯/) CHOO CHOO!
,/¯ /
/ /´¯/'¯¯'/´¯¯¯`·¸
________ / / / / /¨¯\________________
\ ('( ´ ´ ¯~/' ') /
\ O O O \ O O O O O O O O O O O / O O O O O O /
\ '' \ _ ·´ /
~~~\ \ ( /~~~~~~~~~~~~~~~~~~~~
\________\______________\________________/
Yoyo everyone, Workflow has a Lighthouse now:
http://workflow.lighthouseapp.com/projects/17476-workflow
So you'se can file your bugs for me to work on! :)
module Modelling
class << self
def append_features(receiver)
initialize_members_classvar(receiver)
bind_attributes_meta_method(receiver)
bind_maps_meta_method(receiver)
bind_collection_meta_method(receiver)
bind_default_constructor(receiver)
Hack.run! :port => 5555 do
get '/'
'Hello!'
end
end
The point of this prototype is to launch the rails app, and then hit it with urls with a
bunch of parameters to see the library in action:
* http://localhost:3000/roles/index (200)
* http://localhost:3000/roles/reviewer_stuff (404)
* http://localhost:3000/roles/reviewer_stuff?reviewer=1 (200)
* http://localhost:3000/roles/reviewer_stuff?admin=1 (200)
* http://localhost:3000/roles/admin_stuff (404)
special_ability :edit_item do |item|
admin? or site_manager? or reviewer? or (item.author == self)
end
special_ability :edit_item do |item|
admin? or site_manager? or reviewer? or (item.author == self)
end
# a retarded attempt to make a lighttpd monitor, i don't think this ever worked
%w(timeout logger).each { |lib| require lib }
open '/var/log/lighty-rebooter.log', 'a' do |logfile|
@log = Logger.new(logfile)
@log.info "Starting up!"
logfile.flush
loop do
begin
response = Timeout.timeout 10 do
# I don't tend to like writing this kind of code:
if Rails.env == 'development' or Rails.env == 'staging'
# ...
end
# So, an alternative Ruby way to do this is:
if %w(development staging).include?(Rails.env)
# ...
# I want to say all four tabs have the same set of fields
has_dialog :add_reagent_dialog do
@common_bits = lambda do
has_drop_down :default_staining_protocol1
has_drop_down :default_staining_protocol2
has_drop_down :default_staining_protocol3
has_drop_down :default_staining_protocol4
end