Skip to content

Instantly share code, notes, and snippets.

module ActiveModel
class MultiCacheSerializer < ArraySerializer
# XXX ArraySerializer の実装に依存しまくっている
def serializable_array
return super unless perform_caching && cache
entries = object.each_with_object({}) {|item, memo|
if options.has_key?(:each_serializer)
serializer = options[:each_serializer]
elsif item.respond_to?(:active_model_serializer)
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@ympbyc
ympbyc / FunctionalJs.md
Last active April 26, 2023 12:26
Functional JavaScript

Functional JavaScript

2013 Minori Yamashita ympby@gmail.com

-- ここにあなたの名前を追記 --

目次

@syohex
syohex / ginger-api.el
Created April 25, 2013 05:40
ginger API from Emacs
(require 'request) ;; https://github.com/tkf/emacs-request
(require 'json)
(defvar ginger-end-point
"http://services.gingersoftware.com/Ginger/correct/json/GingerTheText" )
;;;###autoload
(defun ginger-region (beg end)
(interactive "r")
(lexical-let* ((text (buffer-substring-no-properties beg end))
#!/usr/bin/env ruby
#------------------------------------------------------------------------------
# Aggregate Print useful information from /proc/[pid]/smaps
#
# pss - Roughly the amount of memory that is "really" being used by the pid
# swap - Amount of swap this process is currently using
#
# Reference:
# http://www.mjmwired.net/kernel/Documentation/filesystems/proc.txt#361
@ursm
ursm / Gemfile
Last active December 14, 2015 10:39
gem 'foreman'
gem 'puma'
gem 'rainbows'
gem 'sendfile'
gem 'sleepy_penguin'
gem 'thin'
gem 'unicorn'
@mala
mala / gist:5002784
Last active December 14, 2015 00:59
このLEMONってのがrapgeniusの人ね。
http://cache.gyazo.com/91f2e906a220fbeef2e9283b0aee597a.png
Unicorn使っても2workerで動いているところに遅いリクエストが3件来たら詰まるよ!!
根本的な解決にならない!!
とか言ってるんですよ。
じゃあ例えば、並列数1x10と並列数2x5で遅いリクエスト5件投げてキューに詰まる確率を考えてみよう。
絵で表すとこう。絵じゃなくて文字だけど。
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@funny-falcon
funny-falcon / changes.md
Last active March 23, 2024 05:53
Performace patch for ruby-1.9.3-p327

Changes:

  • this version includes backport of Greg Price's patch for speedup startup http://bugs.ruby-lang.org/issues/7158 .

    ruby-core prefers his way to do thing, so that I abandon cached-lp and sorted-lf patches of mine.

  • this version integrates 'array as queue' patch, which improves performance when push/shift pattern is heavily used on Array.

    This patch is accepted into trunk for Ruby 2.0 and last possible bug is found by Yui Naruse. It is used in production* for a couple of months without issues even with this bug.

@hayajo
hayajo / changelog_en.md
Last active May 3, 2024 08:29
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形