This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~. ..~.. | |
/´¯/) CHOO CHOO! | |
,/¯ / | |
/ /´¯/'¯¯'/´¯¯¯`·¸ | |
________ / / / / /¨¯\________________ | |
\ ('( ´ ´ ¯~/' ') / | |
\ O O O \ O O O O O O O O O O O / O O O O O O / | |
\ '' \ _ ·´ / | |
~~~\ \ ( /~~~~~~~~~~~~~~~~~~~~ | |
\________\______________\________________/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hack.run! :port => 5555 do | |
get '/' | |
'Hello!' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
special_ability :edit_item do |item| | |
admin? or site_manager? or reviewer? or (item.author == self) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
special_ability :edit_item do |item| | |
admin? or site_manager? or reviewer? or (item.author == self) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
OlderNewer