I hereby claim:
- I am remiprev on github.
- I am remi (https://keybase.io/remi) on keybase.
- I have a public key whose fingerprint is D902 6B81 9AE6 EA3E E4A4 AA02 F64F 552E 0DB2 83C4
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
require 'benchmark' | |
require 'date' | |
Benchmark.bm do |x| | |
x.report('Time.now') { 100_000.times { Time.now.year } } | |
x.report('Date.today') { 100_000.times { Date.today.year } } | |
end |
I hereby claim:
To claim this, I am signing this object:
# config/routes.rb | |
get 'mailer_test', to: 'application#mailer_test' | |
# app/controllers/application_controller.rb | |
def mailer_test | |
render text: UserMailer.welcome_email(User.first).body.to_s | |
end |
$ brew update | |
$ brew install bash | |
$ sudo mv /bin/bash /bin/bash-what-the-hell-man | |
$ sudo ln -s `brew --prefix`/bin/bash /bin/bash |
# Remove the useless and harmful ActiveRecord::SchemaDumper vertical alignment | |
module ActiveRecord | |
class SchemaDumper | |
def table_with_sane_alignment(table, main_stream) | |
# Call the original method to populate our custom stream | |
stream = StringIO.new | |
table_without_sane_alignment(table, stream) | |
# Rewind the stream and remove useless whitespace | |
content = stream.tap(&:rewind).read.gsub(/(?<!^)(?<!\s)[ ]{2,}/, ' ') |
#!/usr/bin/env ruby | |
module Memoizable | |
# This would be `extend ActiveSupport::Concern` in Rails | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def define_memoized(method) |
<?php | |
function RSS_populateItemTemplate( $item ) { | |
$content = $item->children('http://purl.org/rss/1.0/modules/content/')->encoded; | |
return array( | |
'content' => $content | |
); | |
} |
<?php | |
/** | |
* This filter makes it easy to use the same WordPress theme and resources | |
* accross multiple WordPress MU blogs. | |
*/ | |
function my_global_template_url( $url ) { | |
// Uncomment this to use Amazon S3 | |
// return 'http://mybucket.s3.amazonaws.com'; |
diff --git a/svn-color.sh b/svn-color.sh | |
index ac9d15b..6c8c90e 100755 | |
--- a/svn-color.sh | |
+++ b/svn-color.sh | |
@@ -12,14 +12,14 @@ function svn | |
test "$CMDLEN" = "${#CMD}" | |
if [ $? = 1 ] || [ ! -t 1 ] | |
then | |
- $(whereis svn) $CMD | |
+ $(which svn) $CMD |
#!/bin/sh | |
# run this file with sudo and TextEdit will be open as if it was open by root | |
exec /Applications/TextEdit.app/Contents/MacOS/TextEdit |