Skip to content

Instantly share code, notes, and snippets.

View Shinpeim's full-sized avatar

Shinpei Maruyama Shinpeim

View GitHub Profile
@mythosil
mythosil / anyevent_pubsub.pl
Created July 21, 2011 15:02
AnyEvent::Redis pubsub
use strict;
use warnings;
use AnyEvent::Handle;
use AnyEvent::Redis;
my $redis_sub = AnyEvent::Redis->new(
host => '127.0.0.1',
port => 6379,
encoding => 'utf8',
@mythosil
mythosil / localized_disable.pl
Created September 10, 2011 06:07
disable the localization of dirname in macosx
#
# Description:
# Disable the localization of directory' name in Mac OS X.
#
use strict;
use warnings;
my $home = $ENV{'HOME'};
my @directories = (
"$home/Desktop",
@kkosuge
kkosuge / gist:2963444
Created June 21, 2012 02:09
Webページの画像を全て破壊します
javascript:img=document.images;for(i=0;img.length;i++){img[i].src="http://hitode909.appspot.com/glitch/api?uri="+img[i].src};
@hayajo
hayajo / gist:3102792
Created July 13, 2012 04:52
VimでJSON
scriptencoding utf-8
"{{{ curlオプション
if exists('s:curl_opts')
unlet s:curl_opts
endif
let s:curl_opts = "-s -k"
"}}}
"{{{ JSONを取得
@hayajo
hayajo / changelog_en.md
Last active July 19, 2024 05:47
ChangeLog を支える英語

ChangeLog を支える英語

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

ほとんど引用です。

基本形

@rummelonp
rummelonp / 0-git-ignore-template.md
Created December 14, 2012 16:47
.gitignore のテンプレートを出力する git-ignore-template 作った

.gitignore のテンプレートを出力する git-ignore-template 作った

作った。

環境

Ruby の実行環境と json gem が必要。 因みに ruby 1.9.3 でしか動作確認してない。

インストール

@jewel12
jewel12 / Jewelve.rb
Created February 16, 2013 04:06
requireすると標準出力がJewelve.comっぽくなるオモシロrbです
# -*- coding: utf-8 -*-
module StringsOfJewelve
COLOR_NUMBERS = (0..7).to_a
def to_jewelve
return self.split('').map(&:to_random_colored).shuffle.join
end
def to_random_colored
@repeatedly
repeatedly / msgpack_issue_121.md
Last active November 30, 2021 02:09
MessagePackが文字列とバイナリをわけないのは問題?

MessagePackが文字列とバイナリをわけないのは問題?

msgpack/msgpack#121

Objective Cの実装使ってるとある問題にぶちあたった.なので,文字列をちゃんとバイナリ(Raw)と分けるべき,という提案

(*) 俺は熟読したわけではないので,中身が気になる人はちゃんと本スレを読みましょう

そもそもMessagePackとは

msgpackの変更案について

概要:

  • 現行のRaw型をString型として読み替える。
  • Binary型を新設する。
  • 明らかなバイナリはデフォルトでBinary型(新設型)で保存

型システムの変更

  • Binary: バイト列

msgpackの変更案について-3

概要:

  • 現行のRaw型をString型として読み替える。
    • 現行の FixRaw, raw 16, raw 32 は、FixString, string 16, string 32 になる
  • Binary型を新設する。
  • バイト列はBinary型で保存する。そうでなければString型で保存する。

背景