Skip to content

Instantly share code, notes, and snippets.

Avatar

Sadayuki Furuhashi frsyuki

View GitHub Profile
View gist:54029
#include <openssl/sha.h>
#include <openssl/md5.h>
#include <stdio.h>
#include <sys/time.h>
#include <stdint.h>
#include <memory.h>
#include <unistd.h>
static struct timeval g_timer;
View gist:61385
set backup " Automatically make backup
set backupdir=$HOME/.vim-backup " Set backup directory
let &directory = &backupdir
autocmd BufWritePre,FileWritePre,FileAppendPre * call UpdateBackupFile()
function! UpdateBackupFile()
let basedir = "$HOME/.vim-backup"
let dir = strftime(basedir."/%Y%m/%d", localtime())
if !isdirectory(dir)
View gist:68310
gcc -fPIC -c clib.c -o clib.o
g++ -fPIC -c cxxlib.cc -o cxxlib.o
gcc -fPIC -shared clib.o cxxlib.o -o libtest.so
echo "g++ prog.cc -L. -ltest -o prog_cxx"
g++ prog.cc -L. -ltest -o prog_cxx
echo "gcc prog.c -L. -ltest -o prog_c"
gcc prog.c -L. -ltest -o prog_c
View gist:75796
~/Library/Application\ Support/CotEditor/ScriptMenu/Edit\ with\ vi.@9.sh
----
#!/bin/sh
# %%%{CotEditorXInput=Selection}%%%
# %%%{CotEditorXOutput=ReplaceSelection}%%%
tmp=`mktemp ~/tmp/coteditor.XXXXXXXXXX`
cat > "$tmp"
~/Applications/Vim.app/Contents/MacOS/Prelude "$tmp" > /dev/null
View kansit
#!/usr/bin/env ruby
#
# kansit
#
# Copyright (c) 2009 FURUHASHI Sadayuki
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
View gist:168279
/* ./sctpsrv | grep -v "sndrcv"
assoc change: assoc=2, state=comm-up, error=0, outstr=10 instr=10
peer addr change: assoc=2, addr=192.168.20.2 state=confirmed, error=2
peer addr change: assoc=2, addr=192.168.1.2 state=confirmed, error=2
peer addr change: assoc=2, addr=192.168.0.2 state=confirmed, error=2
shutdown event: assoc=2
assoc change: assoc=2, state=shutdown-comp, error=0, outstr=0 instr=0
*/
#include <stdio.h>
View gist:184616
#include <openssl/sha.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
struct CH {
struct node {
node() { }
View gist:185506
#include <iostream>
// header
class Test {
public:
void func();
private:
class util;
friend class util;
View gist:198775
diff --git a/src/mpsrc/wavy_port_epoll.h b/src/mpsrc/wavy_port_epoll.h
index 2000a6c..19dc4d4 100644
--- a/src/mpsrc/wavy_port_epoll.h
+++ b/src/mpsrc/wavy_port_epoll.h
@@ -29,7 +29,9 @@
#include <sys/time.h>
#include <sys/epoll.h>
#include <sys/resource.h>
+#ifndef NO_TIMERFD
#include <sys/timerfd.h>
View gist:253369
#ifndef MP_UTILIZE_H__
#define MP_UTILIZE_H__
#define MP_UTILIZE \
struct mp_util; \
friend struct mp_util
#define MP_UTIL_DEF(name) \
struct name::mp_util : public name