Skip to content

Instantly share code, notes, and snippets.

@kuwa72
kuwa72 / my.ini
Created June 26, 2014 11:32
My MacType Settings(クッキリハッキリやや太め系。漢字は潰れ気味だけどコードは見やすいと思う。)
[General]
Name=my
HintingMode=2
AntiAliasMode=4
NormalWeight=-8
BoldWeight=9
ItalicSlant=-17
EnableKerning=0
GammaMode=0
LcdFilter=2
@kuwa72
kuwa72 / gist:8888915d5f9af7e16f4e
Last active August 29, 2015 14:17
tumblr slim dashborad for Stylish.
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url("https://www.tumblr.com/dashboard") {
/*
I want two-pane dashboard!
span.quote { font-size: smaller; }
.l-container {width: 1200px; padding-left: 0px;}
div#left_column {width: 1200px;}
li.post_container { float:left;}
*/
@kuwa72
kuwa72 / gist:4965652
Created February 16, 2013 05:17
Gauche-head/OpenBSD5.2
diff --git a/configure.ac b/configure.ac
index aa17d7c..619a920 100644
--- a/configure.ac
+++ b/configure.ac
@@ -199,6 +199,14 @@ case $GAUCHE_THREAD_TYPE in
THREADDLLIBS="-lpthread -lrt"
GAUCHE_THREAD_TYPE=pthreads
;;
+ *-*-openbsd*)
+ AC_DEFINE(GC_OPENBSD_THREADS,1,[Define to use OpenBSD threads])
@kuwa72
kuwa72 / scrape.pl
Created February 20, 2013 07:02
CGI, Scrape site-titles in LAN nodes with threads. **Caution! Its SEGV on win32 perl.** LAN内で動いているWebサイトからTitleを抜いてリンク集にするCGIです。 マルチスレッドのおかげで高速に動作しますが、Win32のPerlは異常終了するようです。
#!"C:\xampp\perl\bin\perl.exe"
print "Content-type: text/html\n\n";
use strict;
use warnings;
use threads;
use threads::shared;
use Thread::Semaphore;
@kuwa72
kuwa72 / scrape.scm
Created February 20, 2013 07:08
Gauche CGI, Scrape site-titles in LAN nodes with threads. LAN内で動いているWebサイトからTitleを抜いてリンク集にするCGIです。 マルチスレッドのおかげで概ね高速に動作しますが、Cygwinのpthreadでは情報が抜ける場合が多いです。
#!/Gauche/bin/gosh
(use text.html-lite)
(use rfc.http)
(use rfc.uri)
(use www.cgi)
(use sxml.ssax)
(use sxml.sxpath)
(load "htmlprag.scm")
(use srfi-27) ; random-integer
@kuwa72
kuwa72 / gist:5381197
Last active December 16, 2015 04:59
Patch of pached CIUnit(https://bitbucket.org/kenjis/my-ciunit).
diff -ur ../../temp/kenjis-my-ciunit-27a0665997a8/application/third_party/CIUnit/config/config.php src/application/third_party/CIUnit/config/config.php
--- ../../temp/kenjis-my-ciunit-27a0665997a8/application/third_party/CIUnit/config/config.php 2012-01-18 01:27:00.000000000 +0900
+++ src/application/third_party/CIUnit/config/config.php 2013-04-03 17:56:13.738279800 +0900
@@ -8,6 +8,8 @@
*/
$config['ciu_subclass_prefix'] = 'CIU_';
+$config['log_threshold'] = 4;
+$config['log_path'] = 'logs/';
@kuwa72
kuwa72 / gist:5381320
Created April 14, 2013 03:33
Posgres driver fix 'fetch_version' and 'pg_error' for CodeIgniter 2.1.3
161c161,164
< return "SELECT version() AS ver";
---
> $version = @pg_fetch_array(@pg_query($this->conn_id, "SELECT version() AS ver"));
> $version_array = explode(" ", $version['ver']);
> $version_array['server'] = $version_array[1];
> return $version_array;
700a704,706
> function pg_error() {
> pg_last_error();
@kuwa72
kuwa72 / redminerestInterface.class.php.diff
Created April 24, 2013 10:50
TestLink 1.9.6 and Redmine2 interface patch(for Japanese). Fixed call htmlentities with character encoding for broked multibyte chars. Fix Issues url path.
diff -ru tm//lib/issuetrackerintegration/redminerestInterface.class.php /var/www/tm/lib/issue[0/494]integration/redminerestInterface.class.php
--- tm//lib/issuetrackerintegration/redminerestInterface.class.php 2013-03-10 02:20:54.000000000 +0900
+++ /var/www/tm/lib/issuetrackerintegration/redminerestInterface.class.php 2013-04-24 19:13:06.622029202 +0900
@@ -55,7 +55,7 @@
$base = trim($this-&gt;cfg-&gt;uribase,&quot;/&quot;) . '/'; // be sure no double // at end
if( !property_exists($this-&gt;cfg,'uriview') )
{
- $this-&gt;cfg-&gt;uriview = $base . 'issues/show/';
+ $this-&gt;cfg-&gt;uriview = $base . 'issues/';
}
@kuwa72
kuwa72 / iobench.php
Created March 14, 2016 14:37
Tiny IO benchmark in PHP.
<?php
for ($j = 0; $j < 100; $j++) {
$time = microtime(true);
for ($i = 0; $i < 1000; $i++) {
$fn = sprintf("%04d", $i);
file_put_contents($fn . ".spf", "asdfasdfasdfasdf");
}
echo (microtime(true) - $time);
echo ",";
@kuwa72
kuwa72 / Q4.php
Created December 25, 2016 09:15
シェル芸勉強会 24回 Q4
<?php
require_once 'vendor/autoload.php';
use \PhpOffice\PhpPresentation\IOFactory;
\PhpOffice\PhpPresentation\Autoloader::register();
$oWriter = IOFactory::createReader('PowerPoint2007');
$prst = $oWriter->load(__DIR__ . '/20141019OSC_LT.pptx');