Skip to content

Instantly share code, notes, and snippets.

View attilagyorffy's full-sized avatar
🦜
A UDP packet bar walks a into...

Attila Györffy attilagyorffy

🦜
A UDP packet bar walks a into...
View GitHub Profile
@attilagyorffy
attilagyorffy / Gemfile
Created December 8, 2011 18:15
Installing ruby-debug on ruby 1.9.3
group :development, :test do
gem 'linecache19', :git => 'https://github.com/mark-moseley/linecache.git', :require => false
gem 'ruby-debug-base19', :git => 'https://github.com/mark-moseley/ruby-debug.git', :require => false
gem 'ruby-debug19', :require => 'ruby-debug'
end
@attilagyorffy
attilagyorffy / install_ruby_1-9-3_ubuntu.sh
Created December 13, 2011 16:09
Install Ruby 1.9.3 on Ubuntu Lucid or Oneiric
#!/bin/sh
# Set up the environment. Respect $DISTRIB_CODENAME if it's set.
. /etc/lsb-release
# Fail fast if we're not on Lucid or Oneiric.
if [ $UID != 0 ]; then
echo "You are not root. Installing a package needs root privileges."
exit 1
fi
@attilagyorffy
attilagyorffy / rmate
Created January 23, 2012 13:48 — forked from leon/rmate
Setup TextMate's ssh rmate function
#!/usr/bin/env ruby
# encoding: UTF-8
$VERBOSE = true # -w
$KCODE = "U" if RUBY_VERSION < "1.9" # -KU
require 'optparse'
require 'socket'
require 'fileutils'
@attilagyorffy
attilagyorffy / .powenv
Created March 2, 2012 12:20
Easily enable ruby debugger under Pow
export ENABLE_REMOTE_DEBUGGER_UNDER_POW=true
context "when you set up your it blocks that they depend on your test data" do
it "makes it hard to understand how your program is meant to behave" do
fuck_yourself
end
end
@attilagyorffy
attilagyorffy / instructions_spec.rb
Last active December 14, 2015 21:49
Pro tip: How not to write RSpec tests
context "when you name your it blocks that they depend on your test data" do
it "becomes hard for others to understand how your program is meant to behave" do
go_and_sell_vegetables_at_the_market_instead
end
end
@attilagyorffy
attilagyorffy / rbenv install rbx-2.0.0-rc1 -v
Created March 22, 2013 11:58
Installing Rubinius 2.0 RC1 via RBenv
This file has been truncated, but you can view the full file.
➜ ~ (home) rbenv install rbx-2.0.0-rc1 -v
/var/folders/j7/06jgjgr52blgmvt7gymjgn900000gn/T/ruby-build.20130322124116.61928 ~
Downloading yaml-0.1.4.tar.gz...
HTTP/1.0 200 OK
Content-Type: binary/octet-stream
Content-Length: 471759
Connection: keep-alive
x-amz-id-2: R9kbhU2W7EO380gIyFmu2DmgcBzK6mEmPMvhX1/hCU747YG9D/vWgHDLyJY8r7Vi
x-amz-request-id: 4B0323F91DDFD468
Date: Wed, 12 Dec 2012 20:02:34 GMT
@attilagyorffy
attilagyorffy / experimental_active_record_scope_chain.rb
Last active December 16, 2015 17:09
Experimental ActiveRecord code that DOES NOT FUCKING WORK
# In Rails controllers you often chain scopes together, often the chaining is
# subject to certain conditions in the params hash.
# So I had some Ruby code like this:
@items = MyActiveRecordClass
@items = @items.some_scope_method if some_condition?
@items = @items.another_scope_method
@items = @items.yet_another_scope_method if some_other_condition?
@items = @items.one_more_scope_method
[root@freebsd ~]# RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local rbenv install 2.0.0-p195
Downloading ruby-2.0.0-p195.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/0672e5af309ae99d1703d0e96eff8ea5
Installing ruby-2.0.0-p195...
BUILD FAILED
Inspect or clean up the working tree at /tmp/ruby-build.20131118233113.53696
Results logged to /tmp/ruby-build.20131118233113.53696.log
freebsd% rbenv install 2.0.0-p247
Downloading ruby-2.0.0-p247.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/c351450a0bed670e0f5ca07da3458a5b
Installing ruby-2.0.0-p247...
BUILD FAILED
Inspect or clean up the working tree at /tmp/ruby-build.20131119110747.40295
Results logged to /tmp/ruby-build.20131119110747.40295.log