Skip to content

Instantly share code, notes, and snippets.

View hkoba's full-sized avatar

Kobayasi, Hiroaki hkoba

View GitHub Profile
@hinrik
hinrik / gist:305741
Created February 16, 2010 17:57
Supplying a custom FTS3 tokenizer to SQLite from Perl
use strict;
use warnings;
use Inline C => Config => LIBS => '-lsqlite3';
use Inline C => <<'END';
#include <sqlite3.h>
/* Not included in sqlite.h */
#define SQLITE_PRIVATE static
#define SQLITE_ENABLE_FTS3 1
#define UNUSED_PARAMETER(x) (void)(x)
@xtetsuji
xtetsuji / maillog-hashnize.pl
Last active October 11, 2022 08:08
enhancement of "pflog" for parsing maillog of postfix 2.3 or higher version.
#!/usr/bin/perl
# "pflog" enhancement for parsing maillog of postfix 2.3 or higher version.
# "pflog" see: http://www.tmtm.org/ruby/pflog/pflog-0.3
use strict;
use warnings;
use Time::Local;
use Getopt::Long;
#use Data::Dumper;
@martialboniou
martialboniou / shunit_subst.zsh
Created January 11, 2012 21:57
zsh substitution - example of shell unit test with shunit2
#!/usr/bin/env zsh
which shunit2 &> /dev/null || ( echo "install shunit2" && exit )
setopt shwordsplit
testSubstituteRL(){
local file=/etc/passwd.txt
assertEquals "substitute root" "/etc/passwd" ${file:r}
assertEquals "substitute tail" "passwd.txt" ${file:t}
}
@rnorth
rnorth / gist:2031652
Created March 13, 2012 21:14
Cookie-based authentication with nginx
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
@tokoroten
tokoroten / forth.py
Created May 1, 2012 16:10
forth interpriter implimented by python.
# -*- coding: utf-8 -*-
import re
class forth():
Stack = []
FunctionList = {}
VariableList = {}
ParsedCode = []
@anotherjavadude
anotherjavadude / index.html
Created June 16, 2012 10:20
Most simple d3.js stack bar chart from matrix
<!DOCTYPE html>
<html>
<head>
<title>Simple Stack</title>
<script src="http://d3js.org/d3.v2.js"></script>
<style>
svg {
border: solid 1px #ccc;
font: 10px sans-serif;
shape-rendering: crispEdges;
@pasberth
pasberth / README.md
Created September 3, 2012 15:42
アセンブリで brainfuck 書いてみた

たぶん Mountain Lion でしか動きません。自分の環境でしかテストしてない

compile:

$ as -o brainfuck.o brainfuck.s && ld -o brainfuck -e main brainfuck.o

run:

$ ./brainfuck -e "+++++++++[>++++++++>+++++++++++>+++++<<<-]>.>++.+++++++..+++.>-.------------.<++++++++.--------.+++.------.--------.>+."
@rurban
rurban / blog-todo.md
Created September 17, 2012 23:04
My perl5 TODO list

My perl5 TODO list

Below is a formal list of possible optimizations, which most would agree on. We had these discussion in 2001 with damian were perl6 and perl5i took off. I'd like to work on these for perl5 core and need decisions. Most p5p hackers seem to be informed about the general possibilities and directions, but not all. We'd need this to improve general perl5 performance, and also help static compilation.[1]

@am0c
am0c / gist:3803249
Created September 29, 2012 05:16
emacs config for Mojolicious::Lite file
;
; mmm-mode config for Mojolicious::Lite perl file.
; mmm-mode lib is from here: https://github.com/purcell/mmm-mode
; font locks of [c]perl-mode and mmm-mode conflict each other.
;
(add-to-list 'load-path "~/.emacs.d/packages/mmm-mode")
(require 'mmm-auto)
(require 'mmm-compat)
(require 'mmm-vars)
@hayajo
hayajo / changelog_en.md
Last active May 3, 2024 08:29
ChangeLog を支える英語

ChangeLog を支える英語

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

ほとんど引用です。

基本形