Skip to content

Instantly share code, notes, and snippets.

View Nyoho's full-sized avatar
:octocat:
GitHubing

北䑓如法 Nyoho

:octocat:
GitHubing
View GitHub Profile
@cosmin
cosmin / dupfinder.rb
Created March 30, 2009 09:44
Find and remove duplicate files using Ruby
require 'find'
source = ARGV[0]
destination = ARGV[1]
print "Source = #{source}\n"
print "Destination = #{destination}\n"
files = {}
match_keys = []
@hotchpotch
hotchpotch / unicorn_killer.rb
Created October 3, 2011 08:11
Unicorn process killer utility
# # your config.ru
# require 'unicorn_killer'
# use UnicornKiller::MaxRequests, 1000
# use UnicornKiller::Oom, 400 * 1024
module UnicornKiller
module Kill
def quit
sec = (Time.now - @process_start).to_i
warn "#{self.class} send SIGQUIT (pid: #{Process.pid})\talive: #{sec} sec"
@honjo2
honjo2 / README.md
Created February 24, 2013 11:13
AWSのEC2上でRails+Unicorn+Nginxを実現する

目的

  • AWSのEC2上でRails+Unicorn+Nginxを実現する

前提

  • OSはAmazon Linux AMIを使用する

必要なライブラリをインストール

sudo yum -y install gcc
sudo yum -y install make

sudo yum -y install gcc-c++

@ganta
ganta / japanese-patch-for-emacs-24.3.patch
Created March 12, 2013 00:13
Emacs 24.3への日本語環境用のパッチです
diff --git configure.ac configure.ac
index 62f53a3..850eaa4 100644
--- configure.ac
+++ configure.ac
@@ -1571,7 +1571,7 @@ if test "${HAVE_NS}" = yes; then
leimdir="\${ns_appresdir}/leim"
INSTALL_ARCH_INDEP_EXTRA=
fi
- NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o"
+ NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macim.o"
@itiut
itiut / gist:5820445
Last active July 12, 2023 04:13
twitter bot作成のプロセス

twitter bot作成のプロセス

環境構築

rubyのインストール(ubuntu)

$ sudo apt-get install git build-essential libreadline-dev libssl-dev
$ git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
@eiel
eiel / doorkeeper-participants.md
Created October 9, 2013 11:03
Doorkeeper の参加者一覧が欲しい。調べたことを書いておく。 https://github.com/great-h/great-h.github.io/issues/323
#!/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
anonymous
anonymous / emacs24_3_inline_memleak.sh
Created January 22, 2014 04:06
emacs 24.3でdistnotedを暴走させないパッチ+inlineパッチのビルド手順です。sakito.jpの手順を修正したものです。
EMACS_VER=24.3
curl -O http://ftp.gnu.org/pub/gnu/emacs/emacs-${EMACS_VER}.tar.gz
curl -O https://gist.github.com/anonymous/8553178/raw/c0ddb67b6e92da35a815d3465c633e036df1a105/emacs.memory.leak.aka.distnoted.patch.diff
svn co http://svn.sourceforge.jp/svnroot/macemacsjp/inline_patch/trunk inline_patch
tar xvfz emacs-${EMACS_VER}.tar.gz
cd emacs-${EMACS_VER}
@gnue
gnue / Dockerfile
Last active August 29, 2015 13:56
goreman を使って docker で複数プロセスを起動する
# sshd+nginx
#
# VERSION 0.0.1
FROM ubuntu
RUN apt-get update
# sshd
RUN apt-get install -y openssh-server
@mahm
mahm / AudioManager.cs
Created February 16, 2014 04:27
Unity de sashimi
using UnityEngine;
using System.Collections;
public class AudioManager : SingletonMonoBehaviour<AudioManager> {
AudioClip bgm_Game;
AudioClip se_Tanpopo;
private const int source_bgm_Game = 0;
private const int maxAudio = 10;