Skip to content

Instantly share code, notes, and snippets.

View hnagato's full-sized avatar

nagato hnagato

  • Japan
View GitHub Profile
@koseki
koseki / sendgmail.rb
Created March 27, 2009 16:59
rubyで日本語のメール送信
# Send Japanese mail using Gmail SMTP server. You need tlsmail.
# $ sudo gem install tlsmail
require "rubygems"
require "tlsmail"
require "nkf"
require "net/smtp"
def sendgmail(from, to, subject, body, user, pass, host = "smtp.gmail.com", port = 587)
body = <<EOT
@hnagato
hnagato / DefaultKeyBinding.dict
Last active February 19, 2018 09:28
Cocoaのキーバインドをよりemacsに近づける
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
/* Auto-Paring */
// "(" = ( "insertText:", "()", "moveBackward:" );
// "{" = ( "insertText:", "{}", "moveBackward:" );
// "[" = ( "insertText:", "[]", "moveBackward:" );
"~f" = "moveWordForward:"; /* M-f */
"~b" = "moveWordBackward:"; /* M-b */
"~<" = "moveToBeginningOfDocument:"; /* M-< */
@sunaot
sunaot / coding_guideline.md
Created November 9, 2011 02:11
コーディングガイドライン

コーディング指針

基本方針

こんなコードはよいコード

  • 読みやすいことはよいことだ
    • 見た目が単純だと読みやすい
    • 皆がよく知っている構成は読みやすい (標準に従う。すでに知っているもの (Unix のコマンドとか) に従う。すでにあるものに従う)
  • 書かないことはよいことだ
@dolpen
dolpen / kyoko.user.js
Created May 17, 2012 02:51
これは嘘ニュースです
// ==UserScript==
// @name kyoko
// @namespace http://www.dolpen.net/
// @description これは嘘ニュースです
// @version 0.1
// @include http://kyoko-np.net/*
// ==/UserScript==
(function(w,d){
alert('これは嘘ニュースです');
@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@mikeda
mikeda / nginx.conf
Last active May 12, 2019 23:21
Nginxでクエリストリングを見て振り分け先を切り替える。 http://localhost/test.txt?para1=AAA ならバランサ1、 http://localhost/test.txt?para1=CCC ならバランサ2
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@ms-tg
ms-tg / jdk8_optional_monad_laws.java
Created November 11, 2013 21:14
Does JDK8's Optional class satisfy the Monad laws? Yes, it does.
/**
* ```
* Does JDK8's Optional class satisfy the Monad laws?
* =================================================
* 1. Left identity: true
* 2. Right identity: true
* 3. Associativity: true
*
* Yes, it does.
* ```
@lvl-svasseur
lvl-svasseur / .gitconfig
Last active January 1, 2020 17:29 — forked from coderxin/git-merge-tool
git mergetool config (by command line or .gitconfig)
[merge]
tool = intellij
# tool = Kaleidoscope
[diff]
tool = intellij
# tool = Kaleidoscope
# intellij mergetool config
[mergetool "intellij"]
cmd = /Applications/IntelliJ\\ IDEA\ 13\\ CE.app/Contents/MacOS/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
@dolpen
dolpen / Main.java
Last active December 31, 2015 16:59
絶対に許されない
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* 許せ
*
* 1版:適当探索
* 2版:IO改善
* 3版:最悪でない入力に対する探索打ち切り改善