View gist:54029
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ./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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <openssl/sha.h> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <iostream> | |
struct CH { | |
struct node { | |
node() { } |
View gist:185506
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// header | |
class Test { | |
public: | |
void func(); | |
private: | |
class util; | |
friend class util; |
View gist:198775
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
OlderNewer