Skip to content

Instantly share code, notes, and snippets.

View jpemberthy's full-sized avatar

Juan Pemberthy jpemberthy

View GitHub Profile
[user]
name = Scott Chacon
email = schacon@gmail.com
[alias]
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
unstage = reset HEAD
lol = log --pretty=oneline --abbrev-commit --graph --decorate
branches = !git-branches
st = status
[gui]
<h2>Management & Office Staff</h2>
<ul class="employees">
<r:employees:collection container="list" order="show_order" employee_type="managers">
<r:name_link />
</r:employees:collection>
</ul>
alias lola='git log --graph --decorate --pretty=oneline --abbrev-commit'
require 'timecop'
module TemporalHelpers
# Travels to +time+ and lets the clock keep running.
#
# If a block is given, executes the block at that
# time then returns to the present.
def travel_to(time, &block)
Timecop.travel Time.parse(time), &block
require 'spec/runner/formatter/base_text_formatter'
require 'spec/runner/formatter/no_op_method_missing'
module Spec
module Runner
module Formatter
class ImmediateFailureFormatter < BaseTextFormatter
include NOOPMethodMissing
def example_failed(example, counter, failure)
def create
@post = @huddle.posts.build(params[:post])
@post.user = current_user
deliver_post if @post.save
respond_with @post
end
private
def as_json(options={})
# TODO: users.count and rating_sum are generating way too may queries,
# we should do something about them.
{
:latitude => latitude,
:longitude => longitude,
:title => title,
:id => id,
:users => users.count,
:cap => distance_cap,
// This is a bit non-DRY
// XXX Check how to properly refactor.
var AxAutocompletes = function () {
// Javascript permite nesting. Es mejor que nada quede definido en la parte externa.
var split = function (val) { return val.split( /,\s*/ ); }
var extractLast = function (term) { return split(term).pop(); }
// lift del $.bind
@jpemberthy
jpemberthy / rails_3_1_beta_1_changes.md
Created May 31, 2011 20:57 — forked from ryanb/rails_3_1_rc4_changes.md
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 Beta 1

  • The -j option of the application generator accepts an arbitrary string. If passed "foo", the gem "foo-rails" is added to the Gemfile, and the application JavaScript manifest requires "foo" and "foo_ujs". As of this writing "prototype-rails" and "jquery-rails" exist and provide those files via the asset pipeline. Default is "jquery". [fxn]

  • jQuery is no longer vendored, it is provided from now on by the jquery-rails gem. [fxn]

  • Prototype and Scriptaculous are no longer vendored, they are provided from now on by the prototype-rails gem. [fxn]

  • The scaffold controller will now produce SCSS file if Sass is available [Prem Sichanugrist]

var simplified = { visibility: 'simplified' };
var style = {
'minimal': [
{ featureType: 'all',
stylers: [{ visibility: 'off' }] },
{ featureType: 'water',
stylers: [{ hue: 0 }, { visibility: 'on' }, { lightness: 0 }, { saturation: 0 }] },
{ featureType: 'water', elementType: 'label', stylers: [simplified] },