Skip to content

Instantly share code, notes, and snippets.

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
$ ruby bench_erubis_slim_haml.rb
Rehearsal ---------------------------------------------------------------------------------------
empty loop 0.000000 0.000000 0.000000 ( 0.001055)
erubis 2.690000 0.000000 2.690000 ( 2.697228)
slim 4.200000 0.010000 4.210000 ( 4.196183)
haml 3.1.0.alpha.14 (Bleeding Edge) 19.660000 0.040000 19.700000 ( 19.681350)
haml (ugly) 3.1.0.alpha.14 (Bleeding Edge) 18.940000 0.070000 19.010000 ( 19.004186)
@agnellvj
agnellvj / friendly_urls.markdown
Created September 11, 2011 15:52 — forked from jcasimir/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@chsh
chsh / checkspeed.sh
Created October 26, 2013 02:54
Check internet connection speed using curl's result. :-)
#!/bin/bash
# clear log
cat /dev/null > speed.log
for i in {0..15}
do
echo "Starting $i/15"
echo "speedtest server" >> speed.log
date >> speed.log
@voluntas
voluntas / mqtt.rst
Last active March 1, 2023 06:47
MQTT とはなんだったのか

MQTT とはなんだったのか

更新:2017-05-09
作者:@voluntas
バージョン:3.14
URL:http://voluntas.github.io/

MQTT をググって調べた人向け

Building a GraphQL API in Rails - Part 1

This is a series blog post cover above three topics of GraphQL:

  1. About GraphQL
  2. Building a basic API with Rails
  3. Some best practices

GraphQL is not a new thing, it already exist for a while, the reason I decide to investigate it is because Github released their GraphQL API alpha currently. We know Github has been a very good company for a long time, their RESTful API also becomes some kind of standard for developers, so it's pretty interesting to see what’s new they've been released.

@mattn
mattn / README.md
Last active February 8, 2024 04:58
blacklist/whitelist master/slave に関する情報集め

blacklist/whitelist master/slave に関する情報集め

blacklist/whitelist、master/slave という単語は相応しくないという意見に OSS がどの様に対応すべきかを自身で考える為の情報集めです。見つけ次第、逐次更新していきます。

僕(mattn) 自身は black lives matter に同意をしています。blacklist/whitelist、master/slave という単語を廃止する事が、歴史的背景を持たない文化圏では特定の意味を持たなかった為、個人的には若干思う所はありますが、廃止自身に反対するつもりはありません。

昔から、主副を表す物には master/slave という単語が使われてきました。ハードディスクの IDE、仮想端末(pty)、色々あります。またネットワークの IP フィルタリングに関しては blacklist/whitelist と表記した物が今でも沢山あります。

我々日本人が意識せずに使っていた blacklist/whitelist、master/slave という単語が、人々にどの様に影響しうるのか、今後 OSS としてどの様に関わっていけば良いかを理解する上で、自分なりの情報集めをしたいと思っています。

@dhh
dhh / Gemfile
Created June 24, 2020 22:23
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