Skip to content

Instantly share code, notes, and snippets.

View sotarok's full-sized avatar
🍺
developing Crowi and beer

Sotaro Karasawa sotarok

🍺
developing Crowi and beer
View GitHub Profile
@sotarok
sotarok / vb_encode.hpp
Created August 28, 2009 08:35
Variable Byte Encoder
#include <iostream>
#include <string>
#include <algorithm>
class VBEncoder
{
private:
size_t buffer_size;
uint32_t data;
@sotarok
sotarok / TumblrDownload.php
Created September 9, 2009 17:14
Download image from Tumblr
<?php
/**
* Dowload image file from tumblr.
*
* @author sotarok
* @copyright 2009 sotarok
* @lisence The MIT License
*/
define("BASE_DIR", dirname(__FILE__) . "/");
@sotarok
sotarok / PcjTwitterSearch.php
Created September 10, 2009 18:31
つーかべつに汎用的なやつにしてもよかったんだけど.
<?php
/**
* PcjTwitterSearch.php
* search.twitter.com #pcj09 log
*
* @author sotarok
* @copyright 2009 sotarok
* @license The MIT License
*/
@sotarok
sotarok / .gitignore
Created September 24, 2009 17:14
rapid and stupid search engine script for PHP source code.
._index_*
#!/usr/bin/env php
<?php
array_shift($argv);
list($dir, $refname, $oldrev, $newrev, $newrev_type) = $argv;
$repo = str_replace('/home/git/repositories/', '', $dir);
chdir($dir);
$commit_log_cmd = "git-cat-file $newrev_type $newrev 2>&1";
<?php
/**
*
*
*/
require_once 'Net/Socket/Tiarra.php'; // openpear
try
{
#!/bin/sh
#
# An example hook script to blocks unannotated tags from entering.
# Called by git-receive-pack with arguments: refname sha1-old sha1-new
#
# To enable this hook, make this file executable by "chmod +x update".
#
# Config
# ------
# hooks.allowunannotated
#!/bin/sh
set -e
gitosis-run-hook post-update
git-update-server-info
## copy skeleton of hook script to each repositories (by sotaork)
find /home/git/repositories -name update -exec cp /home/git/git-hook-update-skel {} \;
find /home/git/repositories -name update -exec chmod +x {} \;
diff --git a/install-all-php.sh b/install-all-php.sh
index cf773d0..d942b53 100755
--- a/install-all-php.sh
+++ b/install-all-php.sh
@@ -71,7 +71,7 @@ fi
mkdir -p $HOME/bin
-php_dirs=`find . -type d -path './php-5.?.?'`
+php_dirs=`find . -type d -path './php-5.?.*'`
<?php
/**
* @author sotarok
* @license The MIT License
*/
function smarty_function_gravatar ($param, &$smarty)
{
$email = $param['email'];
$default = $param['default'];