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
;; #+:Emacs | |
(defun unicode-unescape-region (start end) | |
"指定した範囲のUnicodeエスケープ文字(\\uXXXX)をデコードする." | |
(interactive "*r") | |
(save-restriction | |
(narrow-to-region start end) | |
(goto-char (point-min)) | |
(while (re-search-forward "\\\\u\\([[:xdigit:]]\\{4\\}\\)" nil t) | |
(replace-match (string (unicode-char | |
(string-to-number (match-string 1) 16))) |
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 | |
class WebrootController extends AppController { | |
var $uses = null; | |
var $_ext = '.php'; | |
function show() { | |
$path = func_get_args(); | |
$path = implode(DS, $path); | |
if (in_array($path, array('index', 'css', 'test'))) { |
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 | |
class Escaper { | |
public $value = null; | |
public $raw = null; | |
public function __construct($value, $charset = 'UTF-8') { | |
$this->value = htmlspecialchars($value, ENT_QUOTES, $charset); | |
$this->raw = $value; | |
} | |
public function __toString() { |
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 node | |
var stdin = process.openStdin(); | |
var stdout = process.stdout; | |
var input = ''; | |
stdin.setEncoding('utf8'); | |
stdin.on('data', function(data) { | |
if (data) { | |
input += data; |
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 | |
class YoutubeController extends AppController{ | |
public $name = 'Youtube'; | |
public $uses = array(); | |
public $layout = 'default'; | |
public $components = array('Zend','Auth'); | |
public function upload(){ | |
$this->Zend->loadClass('Zend_Gdata_ClientLogin'); |
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 | |
class AppController extends Controller { | |
public $components = array( | |
'Auth' => array( | |
'authenticate' => array( | |
'TwitterKit.TwitterOauth', | |
), | |
), |
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 | |
if (!isset($modules)) { | |
$modulus = 11; | |
} | |
if (!isset($model)) { | |
$models = ClassRegistry::keys(); | |
$model = Inflector::camelize(current($models)); | |
} | |
?> | |
<div class="pagination"> |
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 | |
CAKEPHP_PAH=/usr/local/app | |
if [ ! -d $CAKEPHP_PAH ] | |
then | |
mkdir $CAKEPHP_PAH | |
fi | |
# IPアドレスを取得 | |
IPADDR=`ip addr show | grep eth0 | grep 'inet *' | awk '{print $2;}' | cut -f1 -d '/'` |
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
var PORT = 10443; | |
var SSL_KEY = '___.key'; | |
var SSL_CERT= '___.cert'; | |
var fs = require('fs'); | |
var io = require('socket.io').listen(PORT, { | |
key : fs.readFileSync(SSL_KEY).toString(), | |
cert : fs.readFileSync(SSL_CERT).toString() | |
}); |
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
/** | |
* コンストラクタ | |
* | |
* @access public | |
* @author sakuragawa | |
*/ | |
public function __construct($request = null, $response = null) { | |
// サブクラスのメンバをマージする | |
$this->__mergeSubClass(); |
OlderNewer