Skip to content

Instantly share code, notes, and snippets.

@alindeman
alindeman / Gemfile
Created June 25, 2020 00:52 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@alindeman
alindeman / .Xresources
Created March 24, 2019 14:15 — forked from cocopon/dark.Xresources
.Xresources for Iceberg
! special
*.foreground: #d2d4de
*.background: #161821
*.cursorColor: #d2d4de
! black
*.color0: #161821
*.color8: #6b7089
! red
#!/usr/bin/sudo sh
## ruby_revealer.sh -- decrypt obfuscated GHE .rb files. 2.0.0 to 2.3.1+.
## From `strings ruby_concealer.so`:
##
## > This obfuscation is intended to discourage GitHub Enterprise customers
## > from making modifications to the VM.
##
## Well, good, as long as its not intended to discourage *me* from doing this!
@alindeman
alindeman / gist:383177af82e7af2e27c0
Created May 25, 2014 17:40
Re: Contributing to open source
> Dan Buch of Pittsburgh aka meatballhat suggested I contact you. I'm
> transitioning into Ruby and Rail from another completely unrelated profession
> and I'd like to contribute to open source projects as much as I can. I think
> it'll help me move beyond tutorials and books. I've gone through several of
> them already, including Michael Hartl's free tutorial as well as Pragmatic
> Programmers' Programming Ruby. Do you have any recommendations?
It’s great to hear that you want to contribute to open source! I had dreams of
contributing to Rails itself and maybe even become a regular contributor.
However, the framework code itself was completely overwhelming to me as someone
class Iterator < Enumerator
def initialize(object, &iterate)
super() do |y|
y << object
loop { y << object = iterate[object] }
end
end
end
Rake::Task["assets:environment"].clear
namespace :assets do
task :environment do
Bundler.require(:assets)
end
end
# jruby 1.7.4.dev (1.9.3p392) 2013-03-30 fffffff on Java HotSpot(TM) 64-Bit Server VM 1.7.0_15-b03 [darwin-x86_64]
Object.__id__
Object.instance_variable_set(:@foo, "foo")
o = Object.new
o.__id__
o.instance_variable_set(:@foo, "foo")
p o.__id__ # => 2002
@alindeman
alindeman / gist:5050851
Last active December 14, 2015 07:29 — forked from vanstee/gist:5050689
class Item
def does_something(publishing_house = PublishingHouse.new)
publishing_house.publish(@document)
end
end
it 'publishes the document' do
publishing_house = stub('PublishingHouse')
publishing_house.should_receive(:publish).with(document)
@alindeman
alindeman / omg.rb
Last active December 14, 2015 01:19
class Proc
def !
proc { |*args, &blk| !call(*args, &blk) }
end
end
puts ["", "abc"].detect(&!(:empty?.to_proc))
AARON: So test unit… test in Ruby… test unit use mini tests. It’s a subclass — like it’s actually subclass of mini test. So, all I really did was just change Rails’… so Rails provides a test class like active support test case. …did change super, the class mini test and activate mini test spec is just a sub class of mini test test case. So, all I did was change active support’s class to sub class for main test spec. So it’s not like I mean, everything is completely backwards compatible — you just get spec’ing for free basically.