Skip to content

Instantly share code, notes, and snippets.

View mattn's full-sized avatar
🍛
I love curry 🍛

mattn mattn

🍛
I love curry 🍛
View GitHub Profile
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use 5.010000;
use autodie;
use Furl;
use JSON;
use GDBM_File;
use Encode;
@kazuho
kazuho / gist:5016636
Last active December 14, 2015 02:49
文字列型を新設する場合についてサイズが重要ならば以下のような変態案もあります。
0xd6-MSB-terminated ASCII
0xd7-0xFF-terminated UTF-8
"hello" => d6 68 65 6c 6c ef
"テスト" => d7 e3 83 86 e3 82 b9 e3 83 88 ff
@freeformz
freeformz / WhyILikeGo.md
Last active October 6, 2022 23:31
Why I Like Go

A slightly updated version of this doc is here on my website.

Why I Like Go

I visited with PagerDuty yesterday for a little Friday beer and pizza. While there I got started talking about Go. I was asked by Alex, their CEO, why I liked it. Several other people have asked me the same question recently, so I figured it was worth posting.

Goroutines

The first 1/2 of Go's concurrency story. Lightweight, concurrent function execution. You can spawn tons of these if needed and the Go runtime multiplexes them onto the configured number of CPUs/Threads as needed. They start with a super small stack that can grow (and shrink) via dynamic allocation (and freeing). They are as simple as go f(x), where f() is a function.

@mattn
mattn / vim7-if_mruby.diff
Last active December 11, 2015 21:29
mruby interface for vim
diff -r ccbde540a714 runtime/doc/eval.txt
--- a/runtime/doc/eval.txt Wed Apr 03 21:14:29 2013 +0200
+++ b/runtime/doc/eval.txt Fri Apr 05 21:20:11 2013 +0900
@@ -6412,6 +6412,7 @@
mouse_urxvt Compiled with support for urxvt mouse.
mouse_xterm Compiled with support for xterm mouse.
mouseshape Compiled with support for 'mouseshape'.
+mruby Compiled with MRuby interface |mruby|.
multi_byte Compiled with support for 'encoding'
multi_byte_encoding 'encoding' is set to a multi-byte encoding.
@robotslave
robotslave / gist:4633393
Last active March 31, 2025 20:02
How to get Emoji in your Ubuntu Terminal
<!--
1. Download the Android Jelly Bean fonts and the Symbola font:
https://www.dropbox.com/s/tvtzcnzkvbe0nrt/jelly-bean-fonts.zip
http://users.teilar.gr/~g1951d/Symbola707.zip
2. unzip the files and put AndroidEmoji.ttf and Symbola.ttf (and any of the other fonts that strike your fancy)
in your ~/.fonts/ directory
3. run `fc-cache -f`. You can check to make sure the new fonts
were installed with `fc-list`. You'll probably want to grep the copious output for Symbola or Emoji
@hnaohiro
hnaohiro / go-unzip
Created January 19, 2013 13:01
Golangでzipファイルを解凍するサンプル
package main
import (
"archive/zip"
"io"
"log"
"os"
"path/filepath"
)
anonymous
anonymous / gist:4265878
Created December 12, 2012 07:47
mruby_ccのコンパイル結果
i = 0
while i < 1000000000
5 * 1.7
i += 1
end
puts i
@roxlu
roxlu / main.cpp
Created October 31, 2012 18:54
Testing with libuv, openssl, memory bios, non blocking sockets: how to handle ssl and application data (?)
#include <iostream>
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/pem.h>
#include <uv.h>
#include <vector>
#include <iterator>
#include <algorithm>
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。