$ mysql -u root -p < /usr/local/mysql/share/innodb_memcached_config.sql
mysql> install plugin daemon_memcached soname "libmemcached.so";
$ telnet localhost 11211
<?php | |
// <a> </a> タグ以外をhtmlspecialcharsする関数 | |
function atagigaiwohsc($src,$flags = ENT_QUOTES){ | |
// encode including <a></a> | |
$sanitized = htmlspecialchars($src,$flags); | |
// decode all <a> | |
if(preg_match_all('@<a.*?>@', $sanitized, $matches, PREG_SET_ORDER)){ | |
foreach($matches as $match){ |
#!/bin/sh | |
BRANCH=`git rev-parse --abbrev-ref HEAD` | |
if test $BRANCH = 'master'; then | |
echo 'Commiting to master is forbidden.' | |
exit 1 | |
fi |
void((function() { | |
var editJikoku = function (jikoku) { | |
return function () { | |
var inputForm = jQuery(this); | |
if (inputForm.parents('tr').css('background-color') != 'transparent') { | |
return; | |
} | |
if (inputForm.val() != jikoku) { | |
inputForm.val(jikoku); | |
inputForm.css('background-color', '#fcc'); |
// app/Config/database.php | |
class DATABASE_CONFIG { | |
public $default = array( | |
'datasource' => 'Database/Mysql', | |
'persistent' => false, | |
'host' => 'master.mysql.host', | |
'login' => 'mysql_username', | |
'password' => 'mysql_password', | |
'database' => 'schema_name', |
<?php | |
$apiKey = ''; | |
$apiSecret = ''; | |
if (isset($_GET['cert'])) { | |
$apiSig = md5($apiSecret . 'api_key' . $apiKey . 'cert' . $_GET['cert']); | |
$jsonString = file_get_contents("http://auth.hatena.ne.jp/api/auth.json?api_key={$apiKey}&cert={$_GET['cert']}&api_sig={$apiSig}"); | |
$obj = json_decode($jsonString); | |
if (!$obj->has_error) { | |
echo file_get_contents("http://b.hatena.ne.jp/{$obj->user->name}/rss"); |
#!/usr/bin/ruby | |
# -*- coding: utf-8 -*- | |
# configure | |
API_VERNO = 1 | |
API_TOKEN = '' | |
KNKR_HOST = '' | |
$header = { | |
'Referer' => "http://#{KNKR_HOST}/kcs/port.swf?version=1.3.7", |
#!/bin/bash | |
APP_DIRS=('/path/to/dir' '/path/2/dir') | |
for app_dir in ${APP_DIRS[@]} | |
do | |
cd $app_dir | |
number_of_changed=`git ls-files --modified | wc -l` | |
if test $number_of_changed -gt 0 ; then | |
curl -F text="$app_dir} 以下の${number_of_changed}個のファイルに変更がありました。確認してください。" -F channel= -F token='' https://slack.com/api/chat.postMessage | |
fi |
$ mysql -u root -p < /usr/local/mysql/share/innodb_memcached_config.sql
mysql> install plugin daemon_memcached soname "libmemcached.so";
$ telnet localhost 11211
#!/usr/bin/ruby | |
# -*- coding: utf-8 -*- | |
class FileList | |
def initialize(filelist) | |
@filelist = filelist | |
@disposedlist = nil | |
end | |
def disposeList() |
$ ls -l /opt/local/apache2/conf
bar.example.com.conf
foo.example.com.conf
httpd.conf@ -> bar.example.com.conf
$ sudo a2ensite foo.example.com
$ls -l /opt/local/apache2/conf
bar.example.com.conf
foo.example.com.conf