Skip to content

Instantly share code, notes, and snippets.

View mrkn's full-sized avatar
:octocat:

Kenta Murata mrkn

:octocat:
View GitHub Profile
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {
@makoto
makoto / gist:566419
Created September 5, 2010 23:07
RubyKaigi must die (for at least once).
NOTE: This is English translation of "http://shyouhei.tumblr.com/post/145555071/ruby".
The theme of Ruby Kaigi 2011 is "The last RubyKaigi" and the chariman Takahashi apparently got the
inspiration from this blog which Urabe san wrote a year ago. I translated this so that non Japanese
speaker also understand the context of post RubyKaigi discussions going on in Japanese Ruby community.
あえて言うがRuby会議はそろそろ一回終わってみるべき。
RubyKaigi must die (for at least once).
Original title: Let me say that Ruby Kaigi should end for now.
@mikhailov
mikhailov / ruby_gc.sh
Created March 11, 2011 10:33
Ruby’s GC Configuration
- http://www.coffeepowered.net/2009/06/13/fine-tuning-your-garbage-collector/
- http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration
article’s settings: ("spec spec" took 17-23!sec)
export RUBY_HEAP_MIN_SLOTS=1250000
export RUBY_HEAP_SLOTS_INCREMENT=100000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=30000000
export RUBY_HEAP_FREE_MIN=12500
@waltarix
waltarix / tmux-do-not-combine-utf8.patch
Last active May 29, 2022 09:58
tmux: Fix a problems with displaying Ambiguous-width, Japanese Dakuten and Handakuten signs.
diff --git a/screen-write.c b/screen-write.c
index 15f8d07..8a175a6 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -1334,6 +1334,7 @@ screen_write_cell(struct screen_write_ctx *ctx, const struct grid_cell *gc)
ctx->cells++;
/* If the width is zero, combine onto the previous character. */
+ /*
if (width == 0) {
anonymous
anonymous / gist:1406238
Created November 29, 2011 20:09
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially
@tomohiro
tomohiro / gist:2020862
Created March 12, 2012 09:20
GUNDAM (GitHub Ubuntu Node Dropbox AWS MongoDB) が生まれるまでの流れ
<Tomohiro> orz
<Tomohiro> うける
<gongo_tea> これはなんだろう。土下座してでも来てほしいのか
<gongo_tea> なんか残念なのか
<Tomohiro> 今の時代 LAMP/LAPP のスキルセット持ってても...
<Tomohiro> 的悲壮感ただよってる
<Tomohiro> Ruby/Node/NginX/Unicorn/MongoDB
<Tomohiro> あたりがナウい感じ出るのでは
<m_zuma> RNNUM
<gongo_tea> らんなむ
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

###
# Scheme code is translated to YARV byte code, then evaluated in the
# Ruby Virtual Machine
require 'rbconfig'
require 'dl'
require 'fiddle'
require 'strscan'
class RubyVM
@nobu
nobu / ltsv.rb
Last active December 12, 2015 07:28
LTSV viewer in Ruby
# -*- coding: us-ascii -*-
require 'csv'
require 'yaml'
class LTSV < CSV
attr_accessor :ordered
alias ordered? ordered
def self.def_options(opt, options = {})
@MattSurabian
MattSurabian / PackerPolicy.json
Last active December 11, 2024 19:06
Minimum IAM policy required by AWS for Packer to do its thing. https://github.com/mitchellh/packer Permissions are broken out by API functionality and a resource array has been defined with a wild card for each group. For tighter security resource level permissions can be applied per this documentation: http://aws.typepad.com/aws/2013/07/resourc…
{
"Statement": [
{
"Sid": "PackerSecurityGroupAccess",
"Action": [
"ec2:CreateSecurityGroup",
"ec2:DeleteSecurityGroup",
"ec2:DescribeSecurityGroups",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:RevokeSecurityGroupIngress"