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
# 2009 Copyright Susan Potter <me at susanpotter dot net> | |
# You can read her software development rants at: http://geek.susanpotter.net | |
# Released under CreativeCommons-attribution-noncommercial-sharealike license: | |
# http://creativecommons.org/licenses/by-nc-sa/1.0/ | |
namespace :git do | |
namespace :submodule do | |
desc "Initializes submodules" | |
task :init, :roles => :app do | |
invoke_command "cd #{current_path} && git submodule init", :via => run_method | |
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
# 2007 Copyright Susan Potter <me at susanpotter dot net> | |
# You can read her software development rants at: http://geek.susanpotter.net | |
# Released under CreativeCommons-attribution-noncommercial-sharealike license: | |
# http://creativecommons.org/licenses/by-nc-sa/1.0/ | |
namespace :memcached do | |
desc "Restart the Memcache daemon" | |
task :restart, :roles => :app do | |
deploy.memcached.stop | |
deploy.memcached.start | |
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
# template for Spec Matcher | |
Spec::Matchers.define :be_an_alien do |planet| | |
match do |creature| | |
creature.alien_of?(planet) | |
end | |
failure_message_for_should do |creature| | |
"expected that #{creature} would be an alien of #{planet}" | |
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
namespace :js do | |
desc 'Run Javascript Lint on engine-specific Javascript files.' | |
task :lint do | |
config_file = ENV["JSL_CFG"] || File.join('spec', 'javascripts', 'jsl.conf') | |
if File.exist?(config_file) | |
output = %x[jsl -conf #{config_file}] | |
puts output | |
else | |
puts "Warning: No JSLint configuration file specified nor default location (spec/javascripts/jsl.conf) exists." | |
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
/* 2009-2010 (c) Copyright Susan Potter. http://geek.susanpotter.net */ | |
/* Released under MIT License. */ | |
/* Example using node.js */ | |
(function () { | |
var sys = require('sys'); | |
var http = require('http'); | |
const PORT = 8080; | |
http.createServer(function (req, res) { |
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
// Creative Commons Attribution-Share Alike 3.0 United States License | |
// http://creativecommons.org/licenses/by-sa/3.0/us/ | |
// From blog post: http://bit.ly/dccCPj | |
package net.susanpotter.inclusivemarriage; | |
import java.text.SimpleDateFormat; | |
import java.text.ParseException; | |
import java.util.Date; | |
import org.neo4j.graphdb.*; |
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
# PUT /users/1 | |
def update | |
@user = @session_user | |
respond_to do |format| | |
if @user.update_attributes(params[:user]) | |
format.js do | |
render :json => {:status => 'success', :html => (render_to_string(:partial => 'display_avatar', :locals => { :user => @user })) } | |
end | |
format.html do | |
flash[:notice] = 'The resource was updated' |
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
# Creative Commons Attribution-Share Alike 3.0 United States License | |
# http://creativecommons.org/licenses/by-sa/3.0/us/ | |
# By Susan Potter <http://geek.susanpotter.net> | |
(($) -> | |
editSubmitHandler: (evt) -> | |
form: $(this) | |
data: form.serialize() | |
url: form.attr('action') | |
$.getJSON(url, data, (data, resp) -> | |
$('#notice').html(data['html']) |
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
# Creative Commons Attribution-Share Alike 3.0 United States License | |
# http://creativecommons.org/licenses/by-sa/3.0/us/ | |
# By Susan Potter <http://geek.susanpotter.net> | |
(() -> | |
window: this | |
window.SimpleMath: { | |
square: (x) -> | |
x*x | |
cube: (x) -> | |
x*x*x |
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
# Creative Commons Attribution-Share Alike 3.0 United States License | |
# http://creativecommons.org/licenses/by-sa/3.0/us/ | |
# By Susan Potter <http://geek.susanpotter.net> | |
class BalanceSheet | |
constructor: (companyName, date) -> | |
@companyName: companyName | |
@date: date | |
@assets: [] | |
@liabilities: [] | |
entries: -> |
OlderNewer