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
<?php | |
function get_item_where_froms($filename) | |
{ | |
$command = '/usr/bin/xattr -p "com.apple.metadata:kMDItemWhereFroms" ' | |
. escapeshellarg($filename) . ' 2>&1 | sed "s/ //g"'; | |
$line = exec($command, $output, $retval); | |
if ($retval === 0) { | |
$len = hexdec(substr($line, -2)); | |
$str = ''; |
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 -ur sqlite3-0.7-dev/php_sqlite3.h sqlite3-0.7-dev-php-5.2/php_sqlite3.h | |
--- sqlite3-0.7-dev/php_sqlite3.h 2010-01-03 18:23:27.000000000 +0900 | |
+++ sqlite3-0.7-dev-php-5.2/php_sqlite3.h 2010-06-26 05:58:21.000000000 +0900 | |
@@ -40,6 +40,17 @@ | |
#define PHP_SQLITE3_NUM 1<<1 | |
#define PHP_SQLITE3_BOTH (PHP_SQLITE3_ASSOC|PHP_SQLITE3_NUM) | |
+#define MAKE_COPY_ZVAL(ppzv, pzv) \ | |
+ *(pzv) = **(ppzv); \ | |
+ zval_copy_ctor((pzv)); \ |
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
<?php | |
// アスペクト比が4:3になっているDVファイルのヘッダを書き換えて16:9に変更する | |
define('SEARCH_BEGIN', 0x1C0); | |
define('SEARCH_END', 0x1D0); | |
define('FLAG_4_3', "\xC8"); | |
define('FLAG_16_9', "\xCA"); | |
if ($argc < 2) { | |
fwrite(STDERR, "Too few arguments.\n"); |
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
body { | |
margin: 0; | |
padding: 0; | |
font-family: sans-serif; | |
font-size: 14px; | |
line-height: 100%; | |
background-color: #fff; | |
color: #000; | |
} |
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
#compdef phpman | |
_search_word () { | |
_wanted test expl 'search_word' compadd \ | |
$(command ls $(pear config-get data_dir)/phpman/php-chunked-xhtml \ | |
| sed -e 's/\.html$//' \ | |
| sed -e 's/^.*\.//' \ | |
| sed -e 's/-/_/g' \ | |
| sort | uniq) | |
} |
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
<?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>channel</key> | |
<array> | |
<dict> | |
<key>NHK (総合)</key> | |
<integer>22</integer> | |
</dict> |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/errno.h> | |
#include <sys/xattr.h> | |
#include <sys/param.h> | |
#include <libgen.h> | |
/* | |
cc -Wall -Wextra -Os -std=c99 -o xattr-clean xattr-clean.c |
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
<?php | |
// STDOUT or STDERR は場合に応じて | |
fwrite(STDERR, 'Password: '); | |
if (strncasecmp(PHP_OS, 'WIN', 3) === 0) { | |
// WindowsではエコーバックをOFFにできない? | |
@flock(STDIN, LOCK_EX); | |
$password = fgets(STDIN); | |
@flock(STDIN, LOCK_UN); | |
} else { | |
system('stty -echo'); // エコーバックをOFFにする |
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
<?php for($i=0;$i++<100;)echo$i%3?($i%5?$i:"Buzz"):"Fizz".($i%5?"":"Buzz"),"\n"; |
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
#!/bin/sh | |
otool -L "$1" \ | |
| grep -F '/usr/local/Cellar' \ | |
| perl -pe 's!^[ \t]+(/usr/local/Cellar/[^/]+/[^/]+/(.+?\.dylib)) \(.+$!install_name_tool -change "$1" "/usr/local/$2" "'"$1"'"!' \ | |
| sh |
OlderNewer