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
# vim:set encoding=utf-8: | |
# by ruby1.9.1-p378 | |
require "dbi" | |
require "kconv" | |
DBI.connect("DBI:ODBC:foobar", "sa", "sa") do |dbh| | |
q = "select * from foo_table" | |
dbh.select_all(q) do |row| | |
row[0] = NKF.nkf("-wZ1", row[1]).strip |
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
# coding: utf-8 | |
# | |
#= ついったーとmixiボイスを同期する | |
# | |
require "rubygems" | |
require "mechanize" | |
require "rubytter" | |
# mixiのログイン情報 | |
mixi_id = 'mixi_id' |
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
#!/usr/bin/env ruby | |
data = STDIN.read | |
ident = `git log -1 --pretty=format:"%h %cd %cn"` | |
puts data.gsub /\$Id(:?|:.*)\$/, "$Id: #{ident.to_s} $" |
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
--- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration.php | |
+++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration.php | |
@@ -225,10 +225,16 @@ class Doctrine_Migration | |
*/ | |
public function setCurrentVersion($number) | |
{ | |
- if ($this->hasMigrated()) { | |
- $this->_connection->exec("UPDATE " . $this->_migrationTableName . " SET version = $number"); | |
- } else { | |
- $this->_connection->exec("INSERT INTO " . $this->_migrationTableName . " (version) VALUES ($number)"); |
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 | |
pnums=`pgrep httpd | wc -l` | |
sum=`for p in \`pgrep httpd\`; do grep 'VmHWM' /proc/\$p/status; done | sort | awk '{sum = sum + \$2}END{print sum}'` | |
echo $(($sum / $pnums)) |
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
{ | |
"name": "symfony/framework-standard-edition", | |
"description": "The \"Symfony Standard Edition\" distribution", | |
"autoload": { | |
"psr-0": { "": "src/" } | |
}, | |
"require": { | |
"php": ">=5.3.3", | |
"symfony/symfony": ">=2.1.0,<2.1.x-dev", | |
"doctrine/orm": ">=2.3.0,<2.3.x-dev", |
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 | |
/** | |
* This script set in your project's web/ directory. | |
* Then, you boot built-in web server as below. | |
* | |
* php -S 0.0.0.0:50000 -t /path/to/web/ /path/to/web/router.php | |
*/ | |
if (preg_match('/^(app|app_dev|config)\.php|\.(js|css|html|gif|png|jpg)$/', $_SERVER['REQUEST_URI'])) { | |
return false; | |
} else { |
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 | |
namespace RayDiOnCake\Routing; | |
use Doctrine\Common\Cache\Cache; | |
use Ray\Di\Injector; | |
\App::uses('ClassRegistry', 'Utility'); | |
\App::uses('Dispatcher', 'Routing'); | |
class Dispatcher extends \Dispatcher |
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 | |
$Dispatcher = new RayDiOnCake\Routing\Dispatcher(); | |
$cache = new ApcCache(); | |
$cache->setNamespace('ray/di'); | |
$Dispatcher->setInjectorCache($cache); |
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 | |
use Ray\Di\Injector; | |
App::uses('Controller', 'Controller'); | |
/** | |
* Application Controller | |
* | |
* Add your application-wide methods in the class below, your controllers | |
* will inherit them. |
OlderNewer