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 A | |
def implicit_block_implicit_ensure | |
begin | |
"block" | |
ensure | |
"ensure" | |
end | |
end | |
def implicit_block_explicit_ensure |
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
// includes bindings for fetching/fetched | |
PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
this.page = 1; | |
}, | |
fetch: function(options) { | |
options || (options = {}); | |
this.trigger("fetching"); |
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
Found this tip in comment here: http://www.tipb.com/2011/01/04/tipb-bug-home-button-working-iphone/ | |
1.) Open any application | |
2.) Press and hold the power button until the slide to shutdown swipe bar appears. | |
3.) Release Power button | |
4.) Press and hold Home button Lightly | |
until screen returns to icon screen |
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 little wrapper on yaml/store to give collection and record access to a | |
# transaction yaml store. | |
# | |
# sample usage | |
# | |
# require 'ydb' | |
# | |
# db = Db.new | |
# | |
# collection = db.collection(:posts) |
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
# Automatically add mustaches to any images it can | |
# | |
# | |
module.exports = (robot) -> | |
robot.hear /^(https?:\/\/[^ #]+\.(?:png|jpg|jpeg))(?:[#]\.png)?$/i, (msg) -> | |
src = msg.match[1] | |
unless src.match(/^http:\/\/mustachify.me/) | |
msg.http("http://stacheable.herokuapp.com") |
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 Acccount | |
def to_param | |
slug | |
end | |
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
#! /usr/bin/env ruby | |
## rego command to run -- files to watch | |
# | |
# rego command_to_run on @ -- {lib/*,test/*} | |
# | |
require 'time' | |
require 'pathname' | |
require 'rubygems' |
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
# Place this file in the root of your project directory | |
# eg. APPNAME=tito | |
APPNAME= | |
# eg. APP_SERVERS=([email protected] [email protected]) | |
APP_SERVERS=() | |
# eg. CACHE_DIRS=(public/cache) | |
CACHE_DIRS=() |
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
require 'minitest/unit' | |
require 'celluloid' | |
module MiniTest | |
module Celluloid | |
class Runner < MiniTest::Unit | |
def _run_suites(suites, type) | |
futures = suites.map do |suite| | |
::Celluloid::Future.new { _run_suite suite, type } |
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
########################################################################## | |
# something like this which can dump your db in a portable format. you could use mongodump... etc. | |
# | |
def App.db_snapshot | |
reinitialize_loggers if defined?(reinitialize_loggers) | |
$db_collections = Map.new |
OlderNewer