Skip to content

Instantly share code, notes, and snippets.

View informationsea's full-sized avatar

Yasunobu Okamura informationsea

View GitHub Profile
;;configuration for supervisor
[program:munin-graph]
command=spawn-fcgi -u munin -g munin -U nginx -s /var/run/munin/fcgi-graph.sock -S -M 0600 -n -- /var/www/cgi-bin/munin-cgi-graph
@informationsea
informationsea / myinline.patch
Created April 13, 2015 10:48
Emacs 24.5 Japanese-English patch
diff --git a/configure.ac b/configure.ac
index 4291453..1ed10b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4876,7 +4876,7 @@ case "$opsys" in
## only costs about 1.5K of wasted binary space.
headerpad_extra=1000
if test "$HAVE_NS" = "yes"; then
- libs_nsgui="-framework AppKit"
+ libs_nsgui="-framework AppKit -framework Carbon"
#include <stdio.h>
#include <windows.h>
#include <tlhelp32.h>
#include <tchar.h>
#include <stdbool.h>
#include <process.h>
#include <errno.h>
#ifdef _DEBUG
void printError( TCHAR* msg );
@informationsea
informationsea / git-contribution-analysis.py
Created July 30, 2015 03:58
Git Contribution Analysis
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import git
import os
import os.path
import collections
VERBOSE = False
@informationsea
informationsea / gist:1626548
Created January 17, 2012 12:59
Count lines of files in the directory.
function countlines() {
local basedir=$1
local currentlines='0'
local thislines
shift 1
while [ $1 ] ;do
thislines=`find "$basedir" -type f -name "*.$1" -print0 | xargs -0 cat | wc -l`
currentlines=$(($thislines + $currentlines))
shift 1
done
@informationsea
informationsea / tableformat.c
Created January 17, 2012 12:50
Format tab-separated text
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <stdbool.h>
/**
* @berief Format text table
* @author informationsea
@informationsea
informationsea / tabseparated.py
Created January 17, 2012 13:08
Read Tab-Separeted file by python
def suggest_type_from_str(string):
"""
Arguments:
- `string`:
"""
try:
return int(string)
except:
@informationsea
informationsea / rzip.py
Created February 23, 2012 11:31
Random Readable Compressed File (Licensed by GPL3 or later)
#!/usr/bin/env python2.7
__author__ = 'informationsea'
__copyright__ = 'Copyright (C) 2012 informationsea All Rights Reserved.'
import bz2
import gzip
import struct
class RandomZip(object):
@informationsea
informationsea / indexedfile.py
Created March 31, 2012 09:09
Indexed file reader
#!/usr/bin/env python
"""
Read indexed tab-delimited file
"""
__author__ = '@informationsea'
__copyright__ = 'Copyright (C) 2011 @informationsea All Rights Reserved.'
import sys
@informationsea
informationsea / emacs-24.0.95-lion-fullscreen.patch
Created April 17, 2012 13:28
Emacs 24.0.95 Lion Full Screen Support
=== modified file 'lisp/term/ns-win.el'
--- lisp/term/ns-win.el 2012-02-25 10:04:30 +0000
+++ lisp/term/ns-win.el 2012-04-17 14:04:58 +0000
@@ -533,6 +533,12 @@
(interactive)
(ns-hide-others))
+(declare-function ns-fullscreen-toggle-cocoa "nsfns.m" ())
+
+(defun ns-fullscreen-toggle ()