Skip to content

Instantly share code, notes, and snippets.

@tbutts
tbutts / tmux-migrate-options.py
Last active February 29, 2024 08:11
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
@denkiwakame
denkiwakame / cn.md
Last active January 19, 2022 07:25
苗字変わった

※ 2016年11月時点の内容です. 各市町村, 金融機関ごとに規定が異なるので必ず確認してください

① はんこ屋

  • 認印をすぐ買う
    • 旧姓・新姓の認印が両方入る印鑑ケースが便利. がま口系が丁度2本収納できる.
  • 銀行印は金融機関によって旧姓使用可のところがあるが, 変更した方が良い. 受取は2営業日〜7営業日後.
  • 苗字変わる予定がある婿or嫁はもともと認印・銀行印ともに下の名前で作った方が良い.

② 役所

住民票・税証明カード

@mohamedmansour
mohamedmansour / gist:803631
Created January 31, 2011 04:11
Get and Set localStorage from Content Script
// Content Script to save data.
chrome.extension.sendRequest({storage: 'foo', value: 'bar'});
// Content Script to get data.
chrome.extension.sendRequest({storage: 'foo'}, function(response) {
console.log('foo => ' + response.storage);
});
// Background Page
@hoto17296
hoto17296 / app.py
Created September 6, 2017 10:53
Nginx + uWSGI + Flask on Amazon Linux
from flask import Flask
application = Flask(__name__)
@application.route("/")
def hello():
return "Hello World!"
@Shinpeim
Shinpeim / 00.md
Last active January 16, 2020 13:08
Scala 入学式の資料

Better Java としての Scala

Hello World

  • src/main/scala/Main.scala
object Main {
  def main(args: Array[String]): Unit = {
    println("hello scala!")
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import codecs
import numpy as np
import MeCab
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import KMeans, MiniBatchKMeans
@mbostock
mbostock / .block
Last active June 11, 2018 03:00
Asynchronous Queue
license: gpl-3.0
anonymous
anonymous / gist:8079281
Created December 22, 2013 07:00
function google() {
local str opt
if [ $# != 0 ]; then # 引数が存在すれば
for i in $*; do
str="$str+$i"
done
str=`echo $str | sed 's/^\+//'` #先頭の「+」を削除
opt='search?num=50&hl=ja&ie=euc-jp&oe=euc-jp&lr=lang_ja'
opt="${opt}&q=${str}"
fi
@rike422
rike422 / gist:7096675
Created October 22, 2013 07:48
casper.js使い方

casper.jsとは

CasperJS is an open source navigation scripting & testing utility written in Javascript for the PhantomJS WebKit headless browser and SlimerJS (Gecko). It eases the process of defining a full navigation scenario and provides useful high-level functions, methods & syntactic sugar for doing common tasks such as:

参考資料

コマンド

@Salinger
Salinger / mecab_test.py
Created January 17, 2013 10:24
MeCabの動作確認用。
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import MeCab
m = MeCab.Tagger("-Ochasen")
string = u"それサバンナでも同じ事言えんの?"
# MeCabでUnicode文字列を扱う場合は、一度エンコードする必要がある。
# この際、
# node = tagger.parseToNode(string.encode("utf-8"))