Skip to content

Instantly share code, notes, and snippets.

@frsyuki
frsyuki / article.md
Last active June 11, 2018 07:18
MessagePack for Ruby version 5

MessagePack for Ruby version 5

MessagePack for Ruby の新版をリリースしました!

さらなる高速化

すべてのコードをゼロから再設計し、 シリアライズの大幅な高速化 を達成しました。 ruby-serializers を使って過去のバージョン(v4)と比較したところ、Twitter, 画像, 整数列, 地理データ, 3Dモデル のすべてのデータセットで高速化しました。

@rummelonp
rummelonp / percol_zsh.md
Created December 7, 2012 15:57
percol 入れて zsh と組み合わせたら超便利

percol 入れて zsh と組み合わせたら超便利

だったので紹介

percol とは

percol は入力の1行を1候補として,部分一致かつ AND 検索で絞り込みし,選択した候補を出力するコマンドです.端的に言えば Emacs の anything.el のコマンド版です.

問題・目的

  • 特定のスプレッドシートだけを外から更新したい
  • OAuth は大変めんどうかつ、特定のスプレッドシートのみ権限を与えることができない
  • Google Spread Sheet の XML API が全力で面倒

方法

  1. いじりたいスプレッドシートで [ツール] → [スクリプトエディタ…] を開く (Google ドライブの新規作成から、スクリプトを選んでもいい)
  2. スクリプトエディタに code.gs の内容をはっつける。
class Color
@regex: /(?:#([0-9a-f]{3,6})|rgba?\(([^)]+)\))/i
@fromHex: (hex) ->
if hex[0] is '#'
hex = hex.substring(1, 7)
if hex.length is 3
hex = hex.charAt(0) + hex.charAt(0) +
hex.charAt(1) + hex.charAt(1) +
@tenderlove
tenderlove / .rspec
Created December 3, 2012 00:11 — forked from coreyhaines/.rspec
Active Record Spec Helper - Loading just active record
--colour
-I app
module History
module Shell
def zsh_history_file
@zsh_history_file ||= File.expand_path('~/.zsh_history')
end
def zsh_history
@zsh_history ||= File.read(zsh_history_file)
end
@teppeis
teppeis / tenkaichi-git.md
Last active April 29, 2023 14:58
天下一gitconfig大会

天下一gitconfig大会(サイボウズ社内git勉強会@2012/11/20)の@teppeisの資料です。

ぎっとぎとにしてやんよ

DojoCat

  • gistでmarkdown書いたらbookmarkletでプレゼンになるよ。
@mirakui
mirakui / compile_assets_and_rsync_with_remote_cache.rb
Created November 15, 2012 13:19
Fast deploy using capistrano_rsync_with_remote_cache and turbo-sprockets-rails3
# Requirements:
# https://github.com/vigetlabs/capistrano_rsync_with_remote_cache
# https://github.com/ndbroadbent/turbo-sprockets-rails3
require 'capistrano/recipes/deploy/strategy/rsync_with_remote_cache'
Capistrano::Deploy::Strategy::RsyncWithRemoteCache.class_eval do
def deploy!
update_local_cache
prepare_assets
update_remote_cache
finalize_assets
@amatsuda
amatsuda / deploy.rb
Created November 15, 2012 06:55
perform precompile only when any of the asset files has changed since the last deploy
# do not shallow_clone from Git repo
namespace :deploy do
namespace :assets do
# perform precompile only when any of the asset files has changed since the last deploy
task :precompile, :roles => :web, :except => {:no_release => true} do
from = source.next_revision(current_revision)
asset_changing_files = ['vendor/assets/', 'app/assets/', 'lib/assets', 'Gemfile', 'Gemfile.lock'].select {|f| File.exists? f}
if capture("cd #{latest_release} && #{source.local.log(from)} #{asset_changing_files.join(' ')} | wc -l").to_i > 0
class ApplicationController < ActionController::Base
# see also: http://stackoverflow.com/questions/2385799/how-to-redirect-to-a-404-in-rails
def not_found!
raise ActionController::RoutingError.new('Not Found')
end
end