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
use Symfony\CS\FixerInterface; | |
use Symfony\CS\Tokens; | |
class ShortArraySyntaxFixer implements FixerInterface | |
{ | |
public function fix(\SplFileInfo $file, $content) | |
{ | |
$tokens = Tokens::fromCode($content); | |
for ($index = 0, $c = $tokens->count(); $index < $c; $index++) { |
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
before_filter :hash_options | |
def hash_options | |
params[:options] = Hash[*((params[:options].size % 2) == 0) ? params[:options] : (params[:options] + [nil])] if params[:options] | |
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
gemcutter => redis downloads spec | |
================================= | |
keys | |
---- | |
downloads => global counter for all gem downloads | |
downloads:today => sorted set for downloads from today | |
downloads:rubygem:rails => counter for all rails downloads | |
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads |
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
#! ruby19 | |
require 'pp' | |
Converter = Struct.new :root, :converted do | |
def convert | |
@stack = [] | |
self.converted = {} | |
dfs(root) |
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 Field | |
include MongoMapper::EmbeddedDocument | |
key :name, String | |
key :label, String, :required => true | |
key :helper_text, String | |
key :required, Boolean, :default => false | |
key :widget, String, :required => true | |
key :options, Array # => [[value, label], [value, label], [value, label]] | |
key :selected, String |
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
pl: | |
errors: | |
messages: | |
not_found: "nie znaleziono" | |
already_confirmed: "już został aktywowany" | |
not_locked: "nie był zablokowany" | |
devise: | |
failure: | |
unauthenticated: 'Musisz się zalogować lub zarejestrować aby kontynuować.' |
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 3.1 | |
- Yehuda's Windy City Talk: http://dl.dropbox.com/u/2285145/Rails%203.pdf | |
## RSoC Merges | |
- Identity Map (ET) | |
- Code Reloading (JK) | |
- Benchmarking CI (YK) | |
✓ Engines++ (JV) |
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
// Based on http://snipt.net/boriscy/datetime-jquery-formtastic/ | |
$.tools.dateinput.localize("ja", { | |
months: '1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月', | |
shortMonths: '1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月', | |
days: '日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日', | |
shortDays: '日,月,火,水,木,金,土' | |
}); | |
$.tools.dateinput.conf.format = 'yyyy-mm-dd'; |
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 your application-specific JavaScript functions and classes here | |
// This file is automatically included by javascript_include_tag :defaults | |
$(function() { | |
// Hide the form button | |
$('#products_search input[type="submit"]').hide(); | |
// Push searches onto the location hash | |
var inputTimeoutId = -1; |
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
# encoding: utf-8 | |
module Mongoid #:nodoc: | |
module Associations #:nodoc: | |
module EmbeddedCallbacks | |
# bubble callbacks to embedded associations | |
def run_callbacks(kind, *args, &block) | |
# now bubble callbacks down | |
self.associations.each_pair do |name, meta| | |
if meta.association == Mongoid::Associations::EmbedsMany |
OlderNewer