Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Bogdan Kulbida kulbida

🎯
Focusing
View GitHub Profile
View remove local git branches by regexp
#!/bin/sh
for branch in $(git branch | grep TEXT_MATCH_PATTERN_GOES_HERE | grep -v grep)
do
git branch -d $branch
done
View monitrc
###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file, a complete list of statements and
## options please have a look in the monit manual.
View gist:8073596
class User < ActiveRecord::Base
has_many :columns
def as_json(options={})
attributes.slice(:id, :email, :uuid).merge(:columns => columns)
end
end
class Column < ActiveRecord::Base
belongs_to :user
has_many :boxes
View rspec-syntax-cheat-sheet.rb
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@kulbida
kulbida / gist:4702027
Created Feb 3, 2013
Pow issue with current gemset.
View gist:4702027
rvm env -- `rvm current` >> .powenv
@kulbida
kulbida / ruby_segmentation_fault
Created Nov 30, 2012
Ruby 1.9.3 Segmentation fault
View ruby_segmentation_fault
rvm pkg install iconv
rvm pkg install openssl
rvm reinstall 1.9.3 --with-openssl-dir=~/.rvm/usr --with-iconv-dir=~/.rvm/usr
You can’t perform that action at this time.