Skip to content

Instantly share code, notes, and snippets.

--- a/lib/MT/Object.pm
+++ b/lib/MT/Object.pm
@@ -301,10 +301,10 @@ sub install_properties {
return unless $dbd->need_encode;
my $data = $obj->get_values;
- foreach ( keys %$data ) {
- $data->{$_} = Encode::encode( $enc, $data->{$_} )
- if Encode::is_utf8( $data->{$_} );
- }
@false-git
false-git / test.html
Created April 25, 2014 05:59
以下のhtmlをIEで表示して、ボタンにカーソルを合わせるとレイアウトが変わる
<html>
<body>
<div><h1>this is h1</h1></div>
<div>this is contents.</div>
<form>
<input type="submit" value="button">
</form>
</body>
</html>
@false-git
false-git / org.samba.smbd.plist
Last active January 2, 2016 18:59
smbdをlaunchdから起動するためのplistファイル。 /Library/LaunchDaemons/ に置き、以下のコマンドで有効化 # launchctl load -w /Library/LaunchDaemons/org.samba.smbd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.samba.smbd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/smbd</string>
<string>-F</string>
*** /usr/ports/net/asterisk/work/asterisk-1.8.25.0/contrib/scripts/vmail.cgi Sat Sep 20 09:52:20 2008
--- vmail.cgi Thu Jan 9 13:45:11 2014
***************
*** 20,25 ****
--- 20,26 ----
use DBI;
use Fcntl qw ( O_WRONLY O_CREAT O_EXCL );
use Time::HiRes qw ( usleep );
+ use DateTime::Format::Strptime;
@false-git
false-git / man.patch
Created January 7, 2014 01:34
FreeBSD 9 のmanを日本語対応するパッチ
*** /usr/bin/man Sat Dec 21 23:16:42 2013
--- /usr/local/bin/man Tue Jan 7 09:57:10 2014
***************
*** 330,336 ****
*) nroff_dev="ascii" ;;
esac
! NROFF="$NROFF -T$nroff_dev"
EQN="$EQN -T$nroff_dev"
@false-git
false-git / local.launchd.conf.plist
Created December 6, 2013 14:28
ログイン時に、~/.launchd.conf を読ませる設定
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.launchd.conf</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
@false-git
false-git / system.log
Created November 16, 2013 18:48
どこでもMy Mac設定ありで、InsomniaXのDisable Lid Sleep状態で蓋を閉じたMacBook Proのログ抜粋
Nov 17 00:45:15 mbp2011 kernel[0]: hibernate_write_image done(0)
Nov 17 00:45:15 mbp2011 kernel[0]: sleep
Nov 17 00:45:15 mbp2011 kernel[0]: Wake reason: RTC (Alarm)
Nov 17 00:45:15 mbp2011 kernel[0]: AirPort_Brcm43xx::powerChange: System Wake - Full Wake/ Dark Wake / Maintenance wake
Nov 17 00:46:30 mbp2011 kernel[0]: hibernate_write_image done(0)
Nov 17 00:46:30 mbp2011 kernel[0]: sleep
Nov 17 00:46:30 mbp2011 kernel[0]: Wake reason: RTC (Alarm)
Nov 17 02:33:27 mbp2011 kernel[0]: AirPort_Brcm43xx::powerChange: System Wake - Full Wake/ Dark Wake / Maintenance wake
Nov 17 02:34:42 mbp2011 kernel[0]: hibernate_write_image done(0)
Nov 17 02:34:42 mbp2011 kernel[0]: sleep
@false-git
false-git / bsd.port.mk.patch
Created August 22, 2013 09:09
FreeBSD8のportsで、ライブラリの依存関係チェックに失敗する問題の暫定パッチ
*** bsd.port.mk.orig Mon Aug 19 22:56:16 2013
--- bsd.port.mk Mon Aug 19 23:02:28 2013
***************
*** 5025,5031 ****
for libdir in $$dirs; do \
test -f $${libdir}/$${lib} || continue; \
if [ -x /usr/bin/file ]; then \
! [ `file -b -L --mime-type $${libdir}/$${lib}` = "application/x-sharedlib" ] || continue ; \
fi ; \
found=1 ; \
@false-git
false-git / graphs.inc.php.patch
Created June 15, 2013 22:58
zabbix2 のグラフの文字化け対策
*** graphs.inc.php.orig Sat Jun 15 23:17:46 2013
--- graphs.inc.php Sun Jun 16 07:54:35 2013
***************
*** 666,671 ****
--- 666,674 ----
imagettftext($image, $fontsize, $angle, $x, $y, $color, $ttf, $string);
}
elseif ($angle == 0) {
+ if ($gdinfo['JIS-mapped Japanese Font Support']){
+ $string = mb_convert_encoding($string, "SJIS", "UTF-8");
diff --git a/Makefile b/Makefile
index c282d3b..9b607dd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+CFLAGS += -I/usr/local/include -L/usr/local/lib
+
all: urftopdf
urftopdf:urftopdf.c unirast.h