- aaaaa
alert('aaa'); alert('hello');
module Mongoid | |
module MultiParameterAttributes | |
protected | |
# Override mongoid / lib / mongoid / multi_parameter_attributes.rb | |
def instantiate_object(field, values_with_empty_parameters) | |
return nil if values_with_empty_parameters.all? { |v| v.nil? } || !field | |
values = values_with_empty_parameters.collect { |v| v.nil? ? 1 : v } | |
klass = field.type | |
if klass == DateTime || klass == Date || klass == Time |
module ActionView | |
module Helpers | |
class DateTimeSelector | |
# Override | |
# クレジットカード用に年を2桁で表示する "use_short_year" オプションを追加した | |
def select_year | |
if !@datetime || @datetime == 0 | |
val = '1' | |
middle_year = Date.today.year | |
else |
#!/bin/sh | |
ID=$1 | |
curl http://pastebin.com/Kc9ng18h | grep $ID | |
curl http://pastebin.com/vCMndK2L | grep $ID | |
curl http://pastebin.com/JdQkuYwG | grep $ID | |
curl http://pastebin.com/fw43srjY | grep $ID | |
curl http://pastebin.com/jv4LBjPX | grep $ID |
var a = {aaa: 1, bbb: 2, ccc: 3}; | |
var b = {ddd: 4, eee: 5}; | |
var Hash = function(hash){ | |
this.hash = hash; | |
}; | |
Hash.prototype.merge = function(target) { | |
for (var i in target) { | |
if (typeof target[i] === 'function') { continue; } | |
if (typeof target[i] === 'object') { continue; } |
#!/usr/bin/env perl | |
=head1 Examples | |
$ tail -f access_log | perl colorize.pl | |
$ plackup app.psgi 2>&1 | perl colorize.pl | |
=cut | |
use strict; |
#!/bin/sh | |
# | |
# color | |
# | |
RES_COL=60 | |
MOVE_TO_COL="echo -en \\033[${RES_COL}G" | |
SETCOLOR_SUCCESS="echo -en \\033[1;32m" | |
SETCOLOR_FAILURE="echo -en \\033[1;31m" | |
SETCOLOR_WARNING="echo -en \\033[1;33m" |
var startDate = new Date(2012, 8-1, 31); | |
var endDate = new Date(2012, 8-1, 31); | |
if (startDate.getTime() <= nowDate.getTime() && nowDate.getTime() < endDate.getTime()) { | |
} |
#!/usr/bin/env ruby | |
remote = `git remote -v | grep origin | awk '{print $2}'`. | |
split("\n").first.chomp. | |
sub(/.*:(.*)/, '\1').sub(/\.git/, '') | |
log = `git log --after=yesterday --author='linyows'` | |
#log = `git log --author='linyows'` | |
commits = {} | |
count = 0 |
# 2. Include Sweeping module in your controller(s) to have cache_sweeper | |
# method to be avaliable, or right in ApplicationController so it will be | |
# available in all controllers inheriting from it. | |
class ApplicationController < ActionController::Base | |
include ActionController::Caching::Sweeping | |
# ... | |
end |