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
ActiveAdmin.register Profile do | |
controller do | |
def scoped_collection | |
end_of_association_chain.visible.include(:photos) | |
end | |
end | |
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
#!/usr/bin/ruby -w | |
require 'digest/md5' | |
filename = 'myimage.png' | |
# Generate a hash from the file contents | |
digest = Digest::MD5.hexdigest(File.read(filename)) | |
# Mersenne Twister RNG with seed | |
prng = Random.new(digest) |
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
color molokai | |
let g:molokai_original=0 | |
set gfn=Inconsolata:h16 | |
" Press F4 for MAGIC INDENT | |
map <silent> <F4> mmgg=G`m^ | |
imap <silent> <F4> <Esc> mmgg=G`m^ | |
nnoremap <leader><space> :noh<cr> |
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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by ImageMagick configure 6.7.5-7, which was | |
generated by GNU Autoconf 2.68. Invocation command line was | |
$ ./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.5-7 --disable-dependency-tracking --enable-shared --disable-static --with-modules --without-gslib --with-gs-font-dir=/usr/local/share/ghostscript/fonts --without-magick-plus-plus | |
## --------- ## | |
## Platform. ## |
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 config --global alias.rma '!sh -c "git diff -z --name-only --diff-filter=D | xargs -0 git rm"' |
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
config.middleware.insert_before(::Rack::Lock, ::Refraction) |
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
Refraction.configure do |req| | |
if req.path == "/+" | |
req.permanent! "https://plus.google.com/102443793781999255197" | |
end | |
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
class Bitcoin < CampfireBot::Plugin | |
on_command 'bitcoin', :bitcoin | |
# on_message registered below... | |
def initialize() | |
@log = Logging.logger["CampfireBot::Plugin::Bitcoin"] | |
end | |
def bitcoin(msg) | |
url = "https://mtgox.com/code/data/ticker.php" |
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
(in /data/DevOpsGame/releases/20110517014854) | |
** Invoke environment (first_time) | |
** Execute environment | |
** Invoke resque:work (first_time) | |
** Invoke resque:setup (first_time) | |
** Execute resque:setup | |
** Execute resque:work | |
rake aborted! | |
undefined method `get' for nil:NilClass | |
/data/DevOpsGame/shared/bundled_gems/ruby/1.9.1/gems/redis-namespace-1.0.2/lib/redis/namespace.rb:213:in `method_missing' |
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
desc "remotely console" | |
task :console, :roles => :app do | |
input = '' | |
run "cd #{current_path} && ./script/console #{ENV['RAILS_ENV']}" do |channel, stream, data| | |
next if data.chomp == input.chomp || data.chomp == '' | |
print data | |
channel.send_data(input = $stdin.gets) if data =~ /^(>|\?)>/ | |
end | |
end |
NewerOlder