Skip to content

Instantly share code, notes, and snippets.

View riaf's full-sized avatar
🏠
Working from home

Keisuke SATO riaf

🏠
Working from home
View GitHub Profile
<?php
/**
* なんかよくわからんが PHP 版
*/
$critics = array(
'Lisa Rose' => array(
'Lady in the Water' => 2.5,
'Snakes on a Plane' => 3.5,
'Just My Luck' => 3.0,
<?php
if(!function_exists('parse_ini_string')){
function parse_ini_string($ini, $process_sections=false){
$tmpfile = tempnam(sys_get_temp_dir(), 'INI');
if(@file_put_contents($tmpfile, $ini) !== false){
$r = parse_ini_file($tmpfile, $process_sections);
@unlink($tmpfile);
return $r;
}
return false;
CREATE TABLE `oretter_status_message` (
`id` int(11) unsigned NOT NULL auto_increment,
`body` blob NOT NULL,
`created` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
<?php
class Subversion extends Object
{
static protected $_cmd_path_ = '/usr/bin/svn';
protected $_result_;
static public function config_path($cmd_path){
self::$_cmd_path_ = $cmd_path;
}
static public function cmd_path(){
-- phpMyAdmin SQL Dump
-- version 3.2.2
-- http://www.phpmyadmin.net
--
-- ホスト: localhost
-- 生成時間: 2010 年 1 月 09 日 01:14
-- サーバのバージョン: 5.4.3
-- PHP のバージョン: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, tweepy
from couchdb import Server
from pit import Pit
try:
import simplejson as json
except ImportError:
import json
<?php
date_default_timezone_set('Asia/Tokyo');
$twitter_method = 'sample';
$twitter_user = 'user';
$twitter_pass = 'pass';
$db_name = 'twitter';
$db_user = 'user';
$db_pass = 'pass';
<?php
/**
* Geohash
*
* @author Keisuke SATO
* @license MIT License
*
* # Based
* http://github.com/davetroy/geohash-js/blob/master/geohash.js
* Geohash library for Javascript
<?php
// 雰囲気こんな感じ。
// 実際はファイル分けたりしてる
class HogeController
{
public function index($b) {
return $b->provide('fuga');
// return $this->phpt('index');
}
<?php
require_once 'Net/IRC/Client.php';
class WozozoBot extends Net_IRC_Client
{
protected function on_privmsg($m) {
list($prefix, $msg) = $m->params;
if ($msg == 'wozozo')
$this->privmsg($prefix, 'yudoufu');
}