This file contains hidden or 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
| <?php | |
| /* | |
| * KDB database wrapper by Keiya Chinen <[email protected]> | |
| */ | |
| class KDB { | |
| public function __construct ($user,$pass,$db,$host) { | |
| $this->mysqli = new mysqli($host, $user, $pass, $db); | |
| if ($this->mysqli->connect_error) { |
This file contains hidden or 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
| // サーバ側 | |
| // touch dat.php && chmod 666 dat.php | |
| <?php | |
| if ($_SERVER['REQUEST_METHOD'] == 'POST') { | |
| $fp = fopen('dat.csv','w'); | |
| if ($fp === FALSE) { | |
| die(); | |
| } |
This file contains hidden or 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
| # [email protected] | |
| # thanks to | |
| # main socket program http://d.hatena.ne.jp/perlcodesample/20100512/1276960096 | |
| # fork program http://x68000.q-e-d.net/~68user/net/ | |
| use strict; | |
| use warnings; | |
| use Fcntl; |
This file contains hidden or 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
| # [email protected] | |
| # thanks to | |
| # main socket program http://d.hatena.ne.jp/perlcodesample/20100512/1276960096 | |
| # fork program http://x68000.q-e-d.net/~68user/net/ | |
| use strict; | |
| use warnings; | |
| use Fcntl; |
This file contains hidden or 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
| # [email protected] | |
| use strict; | |
| use warnings; | |
| #use Fcntl; | |
| use Socket; | |
| use FileHandle; | |
| use IPC::Open2; | |
| use File::Basename qw/dirname/; |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <head> | |
| <meta charset='utf-8' /> | |
| <link rel='stylesheet' type='text/css' href="//cdn.keiyac.org/common/reset.css"/> | |
| <style type='text/css'> | |
| html,body { | |
| background:#000; | |
| width:100%; | |
| height:100%; | |
| overflow:hidden; |
This file contains hidden or 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
| <?php // -*- coding: utf-8 -*- > | |
| // [インストール] | |
| // dat というディレクトリを作って、パーミッションを777にします。 | |
| // <form action='flexform.php' method='post'> | |
| // で投げると、勝手にデータベースを作り、フォームにあったカラムを作成します。 | |
| // | |
| // [データ表示] | |
| // form.php? にアクセスすると、テーブル一覧が表示されます。 | |
| // リンクをクリックすると、そのテーブルの内容が表示されます。 |
This file contains hidden or 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 <stdio.h> | |
| #include "kstring.h" | |
| int main () { | |
| char text[] = "aaaasdf*#qwer*#oioio*#"; | |
| char delim[] = "*#"; | |
| t_split *result = ksplit(text,delim); | |
| int i; | |
| for (i=0; i < result->count; ++i) { | |
| printf("%d:%s\n",i,result->splited_ary[i]); |
This file contains hidden or 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/python | |
| import threading, socket, queue , pprint, msgpack | |
| q = queue.Queue(64) | |
| pp = pprint.PrettyPrinter(indent=4) | |
| class Receiver(threading.Thread): | |
| def __init__(self): | |
| self.result = None |
This file contains hidden or 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/perl | |
| use strict; | |
| use warnings; | |
| use Data::Dumper; | |
| $| = 1; | |
| if ($ENV{'QUERY_STRING'} ne '') { | |
| print "Content-type:text/plain\n\n"; |