$ 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
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 | |
//SETTINGS | |
//Facebook APP ID | |
$client_id = 'YOUR_APP_ID'; | |
//Facebook APP SECRET | |
$client_secret = 'YOUR_APP_SECRET'; | |
//WebURI to access this script | |
$redirect_uri = 'http://YOUR.DOMAIN/PATH/TO/this_script.php'; | |
//Scopes U need | |
//Scopes: https://developers.facebook.com/docs/authentication/permissions/ |
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/ruby | |
# -*- coding: utf-8 -*- | |
class FileList | |
def initialize(filelist) | |
@filelist = filelist | |
@disposedlist = nil | |
end | |
def disposeList() |
$ mysql -u root -p < /usr/local/mysql/share/innodb_memcached_config.sql
mysql> install plugin daemon_memcached soname "libmemcached.so";
$ telnet localhost 11211
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 | |
// <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){ |
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/ruby | |
# -*- coding: utf-8 -*- | |
# configure | |
API_VERNO = 1 | |
API_TOKEN = '' | |
KNKR_HOST = '' | |
$header = { | |
'Referer' => "http://#{KNKR_HOST}/kcs/port.swf?version=1.3.7", |
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
// 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', |
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 | |
$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"); |
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 | |
App::uses('CakeEmail', 'Network/Email'); | |
class Base64Email extends CakeEmail { | |
protected function _renderTemplates($content) { | |
$rendered = parent::_renderTemplates($content); | |
array_walk($rendered, function(&$val, $key) { | |
$val = chunk_split(base64_encode($val), 76, "\n"); | |
}); |
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 | |
BUCKUPREMOTENAME='AnotherRemoteName' | |
BRANCHNAME=`git rev-parse --abbrev-ref HEAD` | |
if test $BUCKUPREMOTENAME != $1 ; then | |
git push $BUCKUPREMOTENAME $BRANCHNAME | |
fi |
OlderNewer