This file contains hidden or 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
# array_reactiverecordize_spec.rb | |
require 'spec_helper' | |
describe "Array#reactiverecordize" do | |
let!(:john_doe) { create(:user, first_name: "John", last_name: "Doe", birth_year: '1966')} | |
let!(:mike_pike) { create(:user, first_name: "Mike", last_name: "Pike", birth_year: '1996')} | |
let!(:carl_doe) { create(:user, first_name: "Carl", last_name: "Doe", birth_year: '1926')} |
This file contains hidden or 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
tmux list-panes -s -F "#{pane_pid} #{pane_current_command}" | grep -v tmux | awk '{print $1}' | xargs kill -9 |
This file contains hidden or 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 sh | |
if ! [ $1 ] | |
then | |
echo "USAGE: methods_def_without_parentheses.sh path [optional paths]" | |
exit -1 | |
fi | |
grep -iRn "^\s*def .*$" $* | grep -v ")$" | awk '{if ($4) print $0}' |
This file contains hidden or 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 | |
require 'rubygems' | |
require 'fluent-logger' | |
def fluent_log project, script_name, message | |
Fluent::Logger::FluentLogger.open(nil, :host=>'localhost', :port=>24224) | |
Fluent::Logger.post("mongo.log", {:project => project, :script_name => script_name, :message => message }) | |
end |
This file contains hidden or 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
2013-08-09 17:01:06 +0200 [trace]: plugin/in_forward.rb:150:initialize: accepted fluent socket object_id=70144024060720 | |
2013-08-09 17:01:06 +0200 fluentd.test.log: {"project":"Library","script_name":"Reload books","message":"Started"} | |
2013-08-09 17:01:06 +0200 [trace]: plugin/in_forward.rb:191:on_close: closed fluent socket object_id=70144024060720 |
This file contains hidden or 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
#!/bin/sh | |
fluent_log(){ | |
local project="$1" | |
local script_name="$2" | |
local message="$3" | |
echo "{\""project\"":\""$project"\",\""script_name\"":\""$script_name"\",\""message\"":\""$message\""}" | fluent-cat fluentd.test.log | |
} | |
fluent_log "Library" "Reload books" "Started" |
This file contains hidden or 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
## built-in TCP input | |
## $ echo <json> | fluent-cat <tag> | |
<source> | |
type forward | |
port 24224 | |
</source> | |
## match tag=fluentd.test.** and dump to console | |
<match fluentd.test.**> | |
type stdout |
This file contains hidden or 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 FizzBuzz | |
CONFIG = { 3 => "Fizz", 5 => "Buzz", 7 => "Bar" } | |
attr_reader :number | |
attr_accessor :string | |
def initialize number | |
@number = number | |
@string = "" |
This file contains hidden or 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 'rubygems' | |
require 'git' | |
require 'rainbow' | |
PROJECT_PATHS = %w( | |
/path/to/your/project | |
/path/to/another/project | |
) | |
EMAIL_ADDRESSES = %w( [email protected] ) |
This file contains hidden or 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
Failures: | |
1) Spree::Calculator::PerItem correctly calculates per item shipping | |
Failure/Error: Unable to find matching line from backtrace | |
ArgumentError: | |
marshal data too short | |
# ./app/models/spree/preferences/store.rb:30:in `get' | |
# ./app/models/spree/preferences/preferable_class_methods.rb:14:in `block in preference' | |
# ./app/models/spree/preferences/preferable.rb:70:in `block in preferences' | |
# ./app/models/spree/preferences/preferable.rb:69:in `each' |