Skip to content

Instantly share code, notes, and snippets.

View kosh04's full-sized avatar
🎧

KOBAYASHI Shigeru kosh04

🎧
View GitHub Profile
@kosh04
kosh04 / test-matherr.c
Created July 17, 2014 16:13
Test matherr
// see also:
// http://msdn.microsoft.com/ja-jp/library/k3backsw.aspx
// http://linuxjm.sourceforge.jp/html/LDP_man-pages/man3/matherr.3.html
#define _SVID_SOURCE
#include <math.h>
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
@kosh04
kosh04 / howto.md
Last active August 29, 2015 14:04
MinGW で Readline 6.3 をコンパイルする
@kosh04
kosh04 / wandbox-autoprofiles.el
Last active August 29, 2015 14:05
emacs-wandbox Git:feature/autoprofile にて生成されたプロファイルの例 [2014/08/26 現在]
(require 'wandbox)
;; wandbox-profiles
((:lang "C++" :name "gcc HEAD" :compiler "gcc-head" :options "warning,boost-1.56,sprout,gnu++1y" :ext "cc")
(:lang "C++" :name "gcc" :compiler "gcc-4.9.0" :options "warning,boost-1.56,sprout,gnu++1y" :ext "cc")
(:lang "C++" :name "gcc" :compiler "gcc-4.8.2" :options "warning,boost-1.56,sprout,gnu++1y" :ext "cc")
(:lang "C++" :name "gcc" :compiler "gcc-4.8.1" :options "warning,boost-1.56,sprout,gnu++1y" :ext "cc")
(:lang "C++" :name "gcc" :compiler "gcc-4.7.3" :options "warning,boost-1.56,sprout,gnu++11" :ext "cc")
(:lang "C++" :name "gcc" :compiler "gcc-4.6.4" :options "warning,boost-1.56,sprout,gnu++0x" :ext "cc")
(:lang "C++" :name "gcc" :compiler "gcc-4.5.4" :options "warning,boost-1.56,gnu++0x" :ext "cc")
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define sleep(sec) Sleep(sec * 1000)
@kosh04
kosh04 / dirent.c
Last active August 29, 2015 14:05
dirent.h と _USE_32BIT_TIME_T の組み合わせがバグっているかもしれない話 #mingw32
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
int main(int argc, char *argv[])
{
struct dirent *entry;
DIR *dir;
char *path;
@kosh04
kosh04 / result.md
Last active August 29, 2015 14:05
mktime, localtime 関数は環境変数 TZ を参照する

実行結果

$ gcc prog/c/timezone.c && TZ=UTC ./a.exe
mktime() = 0
gmtime((t=0,&t))         : Thu Jan 01 00:00:00 1970
localtime((t=0,&t))      : Thu Jan 01 00:00:00 1970
gmtime((t=32400,&t))     : Thu Jan 01 09:00:00 1970
localtime((t=32400,&t))  : Thu Jan 01 09:00:00 1970
@kosh04
kosh04 / nicopedia-resanchor-popup.user.js
Last active August 29, 2015 14:07
ニコニコ大百科掲示板のレスアンカーをポップアップ表示するUserScript
// ==UserScript==
// @name Nicopedia Resanchor Popup
// @namespace http://lambda.que.jp/
// @version 0.1.20141108
// @description ニコニコ大百科掲示板のレスアンカーをポップアップ表示する
// @grant GM_addStyle
// @grant GM_getResourceURL
// @grant GM_getResourceText
// @match http://dic.nicovideo.jp/*
// @require http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js
@kosh04
kosh04 / Makefile.pcre
Last active August 29, 2015 14:08
newLISPの埋め込みPCREを最新バージョンに置き換える
# -*- mode: makefile -*-
#
# force update PCRE embedded in newLISP
# ~> wget http://www.newlisp.org/downloads/development/newlisp-10.6.1.tgz
# ~> tar xvf newlisp-10.6.1.tgz
# ~> cd newlisp-10.6.1
# ~> curl -LOk https://gist.githubusercontent.com/kosh04/36d754f6f9a99fcdf374/raw/Makefile.pcre
# ~> make -f Makefile.pcre enable_utf8=1
# ~> make -f Makefile.pcre test
@kosh04
kosh04 / htmlmail.sh
Last active August 29, 2015 14:10
htmlメールを送る
#/bin/sh
MAILTO=xxx@gexmple.com
MAILFROM=yyy@example.com
SUBJECT=Hello
HTML=$(curl -s http://leemunroe.github.io/html-email-template/email.html)
sendmail -i $MAILTO <<EOF
From: $MAILFROM
To: $MAILTO
@kosh04
kosh04 / mingw-w64.patch
Created February 14, 2015 19:27
MinGW-w64 build patch for newlisp v10.6.2
diff --git a/newlisp.c b/newlisp.c
index 211ad93..1b9b851 100644
--- a/newlisp.c
+++ b/newlisp.c
@@ -18,7 +18,6 @@
*/
#include "newlisp.h"
-#include "pcre.h"
#include "protos.h"