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
@hallazzang
hallazzang / main.go
Last active April 28, 2024 06:58
[go] (Windows) ensure all child processes are killed when main program exits
package main
import (
"os/exec"
"unsafe"
"golang.org/x/sys/windows"
)
// We use this struct to retreive process handle(which is unexported)
@defunkt
defunkt / clients.md
Created April 18, 2010 14:09
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

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

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
@daveray
daveray / seesaw-repl-tutorial.clj
Created December 7, 2011 04:55
Seesaw REPL Tutorial
; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.
@voluntas
voluntas / open_momo.rst
Last active March 1, 2024 13:51
OpenMomo プロジェクト
@h-east
h-east / vim_multi_statusline.patch
Last active January 19, 2024 12:52
Vim multi-statusline patch
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 2e58c854e..2220cfb2c 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -9485,6 +9485,7 @@ multi_byte Compiled with support for 'encoding'
multi_byte_encoding 'encoding' is set to a multi-byte encoding.
multi_byte_ime Compiled with support for IME input method.
multi_lang Compiled with support for multiple languages.
+multi_statusline Compiled with 'statuslineheight' support.
mzscheme Compiled with MzScheme interface |mzscheme|.
@tnaka
tnaka / .kati
Created December 17, 2010 02:27
C/C++用Makefileテンプレート作成ツール
default $d $w
d -g
w -W -Wall
a -ansi -pedantic
o -O -DNDUBUG
p -pg
SDL `sdl-config --cflags --libs`
SDL_mixer -lSDL_mixer
X11 -L/usr/X11R6/lib -lX11
cv `pkg-config opencv --libs --cflags`
@mattn
mattn / ssh-env.bat
Created March 12, 2010 11:20
windowsではssh-askpassが使えないのでsetxで環境変数に設定しちゃうぞバッチファイル
@echo off
if "%1" == "-f" goto doit
if "%1" == "-s" goto session
if not "%SSH_AGENT_PID%" == "" goto end
goto doit
:session
for /f "eol=; tokens=1,2 delims==;" %%1 in ('ssh-agent.exe') do (
if "%%1" == "SSH_AUTH_SOCK" setx SSH_AUTH_SOCK %%2 & set SSH_AUTH_SOCK=%%2
if "%%1" == "SSH_AGENT_PID" setx SSH_AGENT_PID %%2 & set SSH_AGENT_PID=%%2
@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.