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
class Table | |
# Checks if the table is available for a given time range. | |
# | |
# @param [Hash(Symbol => DateTime)] params | |
# | |
def available_at?(params) | |
if (params[:at].class != DateTime); raise ArgumentError, "Provide a DateTime for :at";end; | |
if (params[:ending].class != DateTime); raise ArgumentError, "Provide a DateTime for :ending";end; | |
return false if |
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[href="<%=request.path_info%>"]').each(function(s){s.addClassName("selected")}); |
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
Models = require("./def"); | |
sys = require("sys"); | |
sys.println = function(string){ | |
sys.print(string + "\n"); | |
} | |
NodeMapper = {}; | |
NodeMapper.Resource = {}; | |
Models.def ("Person")({ |
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
<html> | |
<head> | |
<title>Checkbox</title> | |
<style> | |
input[type=checkbox] { | |
display:none; | |
} | |
input[type=checkbox] + label | |
{ |
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
function urlify(text) { | |
var urlRegex = /(https?:\/\/[^\s]+)/g; | |
return text.replace(urlRegex, function(url) { | |
return '<a href="' + url + '">' + url + '</a>'; | |
}) | |
// or alternatively | |
// return text.replace(urlRegex, '<a href="$1">$1</a>') | |
} |
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
// ## StorageManager | |
// Aids in interacting with the HTML5 localStorage API. | |
StorageManager = { | |
// Returns the data associated with a key or `false` of no data exists. | |
get: function(key){ | |
var data = localStorage.getItem(key); | |
if (data === "" || data === null){ | |
return false; | |
} else { |
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
backend default { | |
.host = "localhost"; | |
.port = "8000"; | |
} | |
sub vcl_recv { | |
if (req.http.x-forwarded-for) { | |
set req.http.X-Forwarded-For = req.http.X-Forwarded-For ", " client.ip; | |
} else { | |
set req.http.X-Forwarded-For = client.ip; |
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
source "life://127.0.0.1" | |
gem "knowledge" | |
gem "happiness" | |
gem "longevity", "~>85.0", :require => "age" | |
gem "health" | |
gem "responsibility", "0.5.1a" | |
gem "wisdom" | |
gem "fun" |
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 Mycroft | |
module Action | |
class Base | |
def initialize(options) | |
@options = options | |
end | |
def self.create(options) | |
self.new(options).save |