Skip to content

Instantly share code, notes, and snippets.

View tenderlove's full-sized avatar
©️
 ​[object Object] :trollface:

Aaron Patterson tenderlove

©️
 ​[object Object] :trollface:
View GitHub Profile
@tenderlove
tenderlove / gist:7573807
Last active December 28, 2015 22:49 — forked from fxn/gist:7572692
require 'benchmark'
TIMES = 10_000_000
module M
X = ''
module N
module A
module B
def self.x
#!/usr/bin/env ruby
class Module
private
def delegate(*args)
_define_delegators(caller.first, args, false)
end
def delegate_maybe(*args)
require 'benchmark'
class Tester
attr_accessor :hash
HASH = Hash[*(1..100).to_a]
def init_with_dup
@hash = HASH.dup
@tenderlove
tenderlove / trololol.rb
Last active December 21, 2015 06:29 — forked from haileys/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
@tenderlove
tenderlove / brick.md
Last active December 15, 2015 00:29 — forked from joshsusser/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

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 December 3, 2012 00:11 — forked from coreyhaines/.rspec
Active Record Spec Helper - Loading just active record
--colour
-I app
@tenderlove
tenderlove / ruby_gil_test.rb
Created September 26, 2012 20:25 — forked from bsingr/ruby_gil_test.rb
ruby mysql vs sqlite
#!/usr/bin/env ruby
#
require 'benchmark'
require 'thread'
require 'rubygems'
require 'sqlite3'
require 'mysql2'
SQLITE3_DB = 'test.db'
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}"
# -*- encoding: utf-8 -*-
#
# -
require 'psych'
ary = ["Jakub Kuźma", "Timo Rößner"]
p ary.first.encoding
builder = Psych::Visitors::YAMLTree.new({})