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
# Rails developers have long had bad experiences with fixtures for | |
# several reasons, including misuse. | |
# | |
# Misuse of fixtures is characterized by having a huge number of them, | |
# requiring the developer to maintain a lot of data and creating dependencies | |
# between tests. In my experience working (and rescuing) many applications, 80% | |
# of fixtures are only used by 20% of tests. | |
# | |
# An example of such tests is one assuring that a given SQL query with | |
# GROUP BY and ORDER BY conditions returns the correct result set. As expected, |
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
# Code below generates this error | |
# undefined method `value' for "members/fenwick1.gif":String | |
# for line ih = ... | |
module ApplicationHelper | |
def member_image_link(member) | |
return if member.logo.blank? | |
ih = image_height(member.m_logo) | |
ihv = ih.length-2 |
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
Pow can’t start your application. | |
/Users/billlazar/Sites/SmallCommunities raised an exception during boot. | |
SyntaxError: /Users/billlazar/.rvm/gems/ruby-1.9.2-p136@ruby-1.9.2-head/gems/smart_month-1.0.0/lib/smart_month/rulesets.rb:124: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' | |
when :date: qry = "Date.new(#{data[:year... | |
^ | |
/Users/billlazar/.rvm/gems/ruby-1.9.2-p136@ruby-1.9.2-head/gems/smart_month-1.0.0/lib/smart_month/rulesets.rb:125: syntax error, unexpected keyword_when, expecting keyword_end | |
when :freq: qry = 'true' | |
^ | |
/Users/billlazar/.rvm/gems/ruby-1.9.2-p136@ruby-1.9.2-head/gems/smart_month-1.0.0/lib/smart_month/rulesets.rb:151: syntax error, unexpected keyword_end, expecting $end | |
/Users/billlazar/.rvm/gems/ruby-1.9.2-p136@ruby-1.9.2-head/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require' |
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
var auth_middleware = function() { | |
return function(req, res, next) { | |
var urlp= url.parse(req.url, true) | |
if( urlp.query.login_with ) { | |
req.authenticate([urlp.query.login_with], function(error, authenticated) { | |
if( error ) { | |
// Something has gone awry, behave as you wish. | |
console.log( error ); | |
res.end(); | |
} 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
class Event < ActiveRecord::Base | |
has_many :presentations | |
has_many :speakers, :through => :presentations | |
EVT_ACTIVE_STATUSES = %w(on_sale at_door) | |
EVT_INACTIVE_STATUSES = %w(sold_out past) | |
... | |
def status_enum |
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
Public.Views.StarQuestionView = Backbone.View.extend({ | |
template: 'public/common/questions/starQuestion_hb', | |
className: 'questionContainer' | |
}); | |
Public.Form = Backbone.View.extend({ | |
... | |
questionView: function(question, questionNumber) { |
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
ZPCommon.Views.SocialSharesView = Backbone.View.extend({ | |
template: 'public/common/socialShares_hb', | |
id: 'socialShares', | |
className: 'buttonBox', | |
initialize: function() { | |
_.bindAll(this, 'emailShare'); | |
}, | |
events: { | |
'click #emailShareBtn': 'emailShare' | |
}, |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
# https://github.com/nu7hatch/gmail | |
require 'gmail' | |
# https://github.com/sferik/twitter | |
require 'twitter' | |
def mail_tweet(gmail, tid, subj) | |
if !gmail.logged_in? |
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
PROMPT='%{$fg_no_bold[green]%}%3~$(git_prompt_info)%{$reset_color%}» ' | |
RPROMPT='[%*]' | |
# git theming | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[blue]%})" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[magenta]%}✗%{$fg_bold[blue]%})" | |
# LS colors, made with http://geoff.greer.fm/lscolors/ |
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
$ grunt watch | |
>> Local Npm module "grunt-contrib-watch" not found. Is it installed? | |
>> Local Npm module "grunt-contrib-compass" not found. Is it installed? | |
Warning: Task "watch" not found. Use --force to continue. | |
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. |