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 Foo | |
send :private | |
def bar | |
puts "I'm private" | |
end | |
end | |
Foo.new.bar | |
# private method `bar' called for #<Foo:0x00000102816480> (NoMethodError) |
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
GIT | |
remote: https://github.com/rom-rb/devtools.git | |
revision: b2614406dd87d5ea30946da90b9c9a532905472e | |
specs: | |
devtools (0.0.2) | |
PATH | |
remote: . | |
specs: | |
guacamole (0.1.0) |
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
make clean | |
make setup | |
./configure --enable-all-in-one-v8 --enable-all-in-one-libev --enable-all-in-one-icu --enable-relative --enable-maintainer-mode --with-bison=/usr/local/Cellar/bison/3.0.2/bin/bison | |
make -j4 |
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 bash | |
bundle exec rake db:guacamole:purge | |
bundle exec rails runner 'users_count = UsersCollection.all.count; puts "There are #{users_count} users in the DB!"' | |
echo "Creating a test user Bob..." | |
bundle exec rails runner 'u = User.new(username: "Bob", password: "123456", password_confirmation: "123456"); UsersCollection.save u' | |
echo "Fetching the user from the DB..." |
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 | |
require 'logger' | |
require 'terminal-notifier' | |
type, direction, jid = ARGV | |
if type == 'MSG' && direction == 'IN' | |
TerminalNotifier.notify "Message from #{jid}", | |
group: jid, |
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 'trello' | |
@repo, @prefix = ARGV | |
Trello.configure do |config| | |
config.developer_public_key = TRELLO_DEVELOPER_PUBLIC_KEY | |
config.member_token = TRELLO_MEMBER_TOKEN | |
end | |
require 'octokit' |
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
set nocompatible " Turn off vi-compatibility, must be the first config to set | |
filetype off " required for Vundle to work (See Vundle for details) | |
set encoding=utf-8 | |
set timeout timeoutlen=1000 ttimeoutlen=100 " Fix slow O inserts from Gary Bernhardt | |
set shell=/bin/sh " some commands seem to have problems with zsh (i.e. RVM) | |
set cursorline " Highlight the line with the cursor | |
set hlsearch " highlight search | |
set incsearch " Incremental search, search as you type | |
set ignorecase smartcase " Ignore case when searching |
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 | |
require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes.rb" | |
require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb" | |
result = TextMate::UI.request_string( | |
:title => 'Open Rubygem', | |
:prompt => 'Name of the gem to open', | |
:default => ENV['TM_CURRENT_WORD'] || "", | |
:button1 => 'Open' |
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 HouseDetail | |
def foo | |
return [1,2,3] | |
end | |
end | |
class KeyInvoker | |
instance_methods.reject {|meth| meth.to_s =~ /^_/ }.each { |meth| undef_method(meth.to_sym) } |
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
acf, x = [], [] | |
time_val = 0.002 | |
i = time_val | |
# init function 'x[i] = A0 * cos(2*pi*f*i); f = 100Hz' | |
freq = 100.0 # Hz | |
sample_window = (freq/time_val).to_i+1 | |
(freq*2/time_val).to_i.times do | |
# puts "#{i}: #{2.0*Math::PI*f*i}" |
OlderNewer