Skip to content

Instantly share code, notes, and snippets.

@lestrrat
lestrrat / mecab.go
Created March 10, 2014 05:00
俺俺 golang mecabバインディング(mecabで日本語をトークナイズするためのミニマルなヤツ)
package tokenizer
/*
#cgo CFLAGS: XXX CHANGE ME XXX
#cfo LDFALGS: XXX CHANGE ME XXX
#include <mecab.h>
struct mecab_t {}
*/
import "C"
import "errors"
@koemu
koemu / getswap.sh
Created December 18, 2013 01:09
各プロセスのスワップ使用量を調べる。 なお、root or sudo での実行が必要。 参照元: http://northernmost.org/blog/find-out-what-is-using-your-swap/
#!/bin/bash
# Get current swap usage for all running processes
# Erik Ljungstrom 27/05/2011
# Updated: 2013-11-13 Yuichiro Saito
SUM=0
OVERALL=0
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do
PID=`echo $DIR | cut -d / -f 3`
PROGNAME=`ps -p $PID -o comm --no-headers`
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'`
@shiumachi
shiumachi / Goでmecabを使う
Last active December 25, 2015 11:59
#gocon 2013 Autumn での成果物。
* go のコンパイル
brew のインストールファイルにはファイルが欠けているものがあるので、ソースから go をビルドする必要がある
ソースは以下のコマンドでとってこれる。
$ hg clone -u release https://code.google.com/p/go
GOROOTの変更を忘れずに。
@j3tm0t0
j3tm0t0 / ec2ssherror.md
Last active September 30, 2021 07:40
EC2にsshでログインできなくなった場合の対処法

EC2にsshでログインできなくなった場合の対処法


##Connection Timeout または No route to host ###ヘルスチェックステータス1/2 OSレベルでの問題が起きています。
→ インスタンスをRebootしてみましょう。 ###ヘルスチェックステータスが0/2 物理ホスト障害の可能性があります。
→ インスタンスをStop/Startしてみましょう(別の物理ホストに移動させる事ができます)
※ Stoppingの状態で停止しない場合には、force stopを行います(Management Consoleから2回目のstop/ec2-stop-instances --force i-xxxxxxxx)

@hayajo
hayajo / changelog_en.md
Last active May 3, 2024 08:29
ChangeLog を支える英語

ChangeLog を支える英語

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

ほとんど引用です。

基本形

@benjchristensen
benjchristensen / index.html
Created May 2, 2012 19:34
Simple Line Graph using SVG and d3.js
<html>
<head>
<title>Simple Line Graph using SVG and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
> perl -E 'say "生" & "死"'
生 Life U+751F \xe7\x94\x9f 11100111 10010100 10011111
死 Death U+6B7B \xe6\xad\xbb 11100110 10101101 10111011
愛 Love u+611B \xe6\x84\x9b 11100110 10000100 10011011
@billdawson
billdawson / android_scons_speedups.md
Created January 11, 2012 21:41
Speeding up Titanium Build

Speeding up Titanium Mobile Build

(The command examples assume OS X).

Just about everything that happens when you enter scons is for Android. So anything you can do to speed up the Android part of our build will be useful.

  • Android NDK r7 can use ccache. We get huge improvements in build time with it. So install it (if you have HomeBrew, brew install ccache) then set a shell variable NDK_CCACHE to point to it. I.e., for me, having installed it with brew, it would be export NDK_CCACHE=/usr/local/bin/ccache.

  • NDK can also parallelize while compiling. Set a shell variable NUM_CPUS to (according to Opie) 2x the number of cores in your machine. A quick way to get the # cores on your machine in OS X is system_profiler | grep "Number Of Cores" in terminal. I have 2 cores, so my shell var setting is export NUM_CPUS=4.

From dea49e3d1900ffdc56a2077d1d701ec9e38bc58b Mon Sep 17 00:00:00 2001
From: Ryan Dahl <ry@tinyclouds.org>
Date: Wed, 28 Sep 2011 17:43:20 -0700
Subject: [PATCH] net: Fix string-concat hot path bug
Also removes functionality added in f9fec3a2d65580b7e39edc9afd5904cd4775c87c
because it changes API. (That patch shouldn't have been added anyway.)
---
lib/net.js | 20 ++++++++---
test/simple/test-net-write-callbacks.js | 56 +++++++++++++++++++++++++++++++
@bradenpowers
bradenpowers / MyObject.js
Created September 9, 2011 22:45 — forked from kwhinnery/Person.js
Monkey patch for require in Titanium Mobile
exports.Person = function(firstName,lastName) {
this.firstName = firstName;
this.lastName = lastName;
};