Using RAILS 2.3.5
$ rails foobar
$ cd foobar
$ script/generate controller SpecialEvents
Add/edit the following files to those in this gist.
$ rake db:migrate
$ rake test
function maybe(value) { | |
var obj = null; | |
function isEmpty() { return value === undefined || value === null } | |
function nonEmpty() { return !isEmpty() } | |
obj = { | |
map: function (f) { return isEmpty() ? obj : maybe(f(value)) }, | |
getOrElse: function (n) { return isEmpty() ? n : value }, | |
isEmpty: isEmpty, | |
nonEmpty: nonEmpty | |
} |
var CountdownLatch = function (limit){ | |
this.limit = limit; | |
this.count = 0; | |
this.waitBlock = function (){}; | |
}; | |
CountdownLatch.prototype.countDown = function (){ | |
this.count = this.count + 1; | |
if(this.limit <= this.count){ | |
return this.waitBlock(); | |
} |
# The beginnings of a declarative model syntax for CoffeeScript. | |
# SEE: http://almostobsolete.net/declarative-models-in-coffeescript.html | |
# Thomas Parslow | |
# Email: [email protected] | |
# Twitter: @almostobsolete | |
# The top part is the setup, see below that for the demo | |
# To see this run right away try copy pasting it into the 'Try | |
# CoffeeScript' box at http://jashkenas.github.com/coffee-script/ |
require "rake/clean" | |
DEVELOPMENT_URI = "$HOME/Sites/test_site" | |
PRODUCTION_URI = "[email protected]:path/to/public_html" | |
CLEAN.include "_site" | |
CLOBBER.include "_includes/*.html_frag" | |
def jekyll(opts = "", path = "") | |
sh "rm -rf _site" |
Using RAILS 2.3.5
$ rails foobar
$ cd foobar
$ script/generate controller SpecialEvents
Add/edit the following files to those in this gist.
$ rake db:migrate
$ rake test
body { | |
font: Arial; | |
/* | |
font: 18px/27px 'YanoneKaffeesatzRegular', Arial, sans-serif; | |
font-family:"Myriad Pro",georgia, helvetica, arial, sans serif; | |
*/ | |
font-size:larger; | |
background:black; color:white; margin-left:300px; width:500px; padding:20px} | |
a {color:yellow; background:black;} | |
a:hover {color:black; background:yellow;} |
# Sets the current person in the session from the person fixtures. | |
def logged_in_as(person, &block) | |
context "logged in as #{person}" do | |
setup do | |
@instructor = Factory(instructor) if instructor.is_a? Symbol | |
InstructorSession.create(instructor) | |
end | |
merge_block(&block) | |
end |
#!/bin/bash | |
# SPDX-License-Identifier: MIT | |
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]> | |
## | |
## This script is licensed under the terms of the MIT license. | |
## https://opensource.org/licenses/MIT | |
# | |
# Lockable script boilerplate | |
/** | |
* Shamlessly copied from http://snipt.net/boriscy/datetime-jquery-formtastic/ | |
* | |
* This did not function with formtastic version 0.9.10 | |
* I had to move the live("change") event below the initializing part | |
* I also had to adjust the jQuery selections as formtastic uses <ol>'s to | |
* seperate every select box. | |
*/ | |
$(document).ready(function() { |