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 / gist:33390
Created December 8, 2008 07:12
php simple chat
<?php
define("URL", "http://あなたの設置したPHPファイルのURL");
define("TIME", time());
define("__THIS_FILE__", file_get_contents(__FILE__));
define("__THIS_SCRIPT__", substr(__THIS_FILE__, 0, strpos(__THIS_FILE__, "__" . "halt_compiler();") + 19));
$logs = explode("\n", substr(__THIS_FILE__, strpos(__THIS_FILE__, "__" . "halt_compiler();") + 19));
if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) {
if (isset($_POST['text']) && !empty($_POST['text'])
&& isset($_POST['name']) && !empty($_POST['name'])) {
<?php
define ('SMARTY_DIR', '/path/to/smarty/'); // 設置したSmarty本体へのパスを設定します(絶対パス)
require_once 'Smarty/Smarty.class.php';
$smarty = new Smarty();
$smarty->template_dir = '/path/to/templates/'; // 設置したtemplates への絶対パス
$smarty->compile_dir = '/path/to/templates_c/'; // 設置したtemplates_cへの絶対パス
--- dict_orig.php 2009-01-16 21:44:35.000000000 +0900
+++ dict.php 2009-01-17 01:35:08.000000000 +0900
@@ -15,19 +15,17 @@
$d = false;
$usage = null;
if ($argc > 1) {
- foreach ($argv as $key => $val) {
- if ($argv[$key] === basename(__FILE__)) {
- continue;
<?php
/**
* Echo php builtin classes, interfaces, functions, constants for vim dictionary
*
* eg:# php dict.php | sort > ~/.vim/dict/php_functions.dict
*
* @version $id$
* @copyright 2009 Heavens hell
* @author Heavens hell <[email protected]>
* @license New BSD License
// limechat popup script
var list = [
'nequal'
,'phpstudy'
,'twitter'
,'wassr'
];
function checkBalloon(prefix, channel, text)
@sotarok
sotarok / gist:55563
Created January 31, 2009 14:40
github-pull-queue-observe
<?php
/**
* github-pull-queue-observe.php
*
* @description file queue
*/
define("__DIR__", realpath(dirname(__FILE__)));
echo __DIR__;
<?php
/**
*
* The MIT License
*
* Copyright (c) 2009 Sotaro KARASAWA a.k.a. sotarok <sotaro.k [at] gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
# screen のステータスバーに現在実行中のコマンドを表示
# ref. http://nijino.homelinux.net/diary/200206.shtml#200206140
if [ "$TERM" = "screen" ]; then
chpwd () {
echo -n "_`dirs`\\"
ls
}
preexec() {
# see [zsh-workers:13180]
# http://www.zsh.org/mla/workers/2000/msg03993.html
<?php
$ids = array(
'1217330732',
'1196052839',
'1191016305',
'1114782154',
'1182842477',
'1160202787',
);
<?php
/**
*
*
*/
define("YOUTUBE_URL", 'http://www.youtube.com/');
define("YOUTUBE_USER_UPLOAD_URL", 'http://gdata.youtube.com/feeds/api/users/%s/uploads');
require_once 'initializer.php';