Skip to content

Instantly share code, notes, and snippets.

Avatar
©️
 ​[object Object] :trollface:

Aaron Patterson tenderlove

©️
 ​[object Object] :trollface:
View GitHub Profile
View gist:7573807
require 'benchmark'
TIMES = 10_000_000
module M
X = ''
module N
module A
module B
def self.x
View delegate.rb
#!/usr/bin/env ruby
class Module
private
def delegate(*args)
_define_delegators(caller.first, args, false)
end
def delegate_maybe(*args)
View the_dup_cost.rb
require 'benchmark'
class Tester
attr_accessor :hash
HASH = Hash[*(1..100).to_a]
def init_with_dup
@hash = HASH.dup
View trololol.rb
module Kernel
def int(mid)
meth = instance_method(mid)
define_method(mid) { |*args, &bk|
val = meth.bind(self).call(*args, &bk)
raise TypeError, "#{mid} did not return an Integer" unless val.is_a? Integer
val
}
mid
end
View brick.md

Dear Congressman McDermott,

I am writing about an issue in the interaction of technology, crime, and personal safety. I am a resident of Seattle and live in the 7th District, so I approach you as my representative.

Here on Capitol Hill, as in many urban areas, we are suffering with a crime wave of smartphone muggings. A good friend of mine was mugged while riding ths bus, the mugger grabbed the phone and ran off the bus with his phone.

While there are things individuals and the community can do to protect ourselves, I think phone manufacturers and carriers can act far more effectively. The problem is that there is no financial incentive for them to take action. On the contrary, they benefit financially every time a phone is stolen and a replacement must be purchased, or someone who acquires a stolen phone pays for cellular service.

**I would like you to sponsor legislation that would require smartphone manufacturers and mobile carriers to include features that would render a stolen phone inoperative. Phon

View Psych: control characters are not allowed at line 1 column 1
ko:
"emails":
"greeting": "%{name} 님,"
"happy_renting": "즐거운 여행되세요!"
"best_regards": "행복하세요."
"roomorama_team": "루모라마 팀"
"best": "최고의,"
"user_says": "%{name} 님의 메세지입니다:"
"inquiry_notice": "*** 문의하신 내용에 대한 최신 정보는 루모라마 홈페이지 게시판을 참조하세요. ***"
"inquiry_notice_html": "본 문의내용에 대한 최신정보는 루모라마 홈페이지상의 %{inquiry_summary}을 참고해 주세요."
@tenderlove
tenderlove / .rspec
Created Dec 3, 2012 — forked from coreyhaines/.rspec
Active Record Spec Helper - Loading just active record
View .rspec
--colour
-I app
@tenderlove
tenderlove / ruby_gil_test.rb
Created Sep 26, 2012 — forked from bsingr/ruby_gil_test.rb
ruby mysql vs sqlite
View ruby_gil_test.rb
#!/usr/bin/env ruby
#
require 'benchmark'
require 'thread'
require 'rubygems'
require 'sqlite3'
require 'mysql2'
SQLITE3_DB = 'test.db'
View gist:3352499
require 'date'
require 'time'
require 'active_support/all'
p_inf = 1.0 / 0.0
n_inf = -1.0 / 0.0
module InfiniteComparable
def <=> (other)
conversion = :"to_#{self.class.name.downcase}"
View gist:3125875
# -*- encoding: utf-8 -*-
#
# -
require 'psych'
ary = ["Jakub Kuźma", "Timo Rößner"]
p ary.first.encoding
builder = Psych::Visitors::YAMLTree.new({})