This file contains hidden or 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
sudo aptitude install git apache22 gitweb |
This file contains hidden or 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
shell> cd /path/to/hoge |
This file contains hidden or 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 (!class_exists('WP_AddPage')): | |
class WP_AddPage { | |
private $rule = null; | |
private $title = null; | |
private $callback = null; | |
private $template = null; | |
private $filter = false; |
This file contains hidden or 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 (!class_exists('WP_AddRewriteRules')): | |
class WP_AddRewriteRules{ | |
private $rule = null; | |
private $query = null; | |
private $callback = null; | |
function __construct($rule, $query, $callback) | |
{ |
This file contains hidden or 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 | |
// 年度が始まる日 | |
define('ANNUAL_START_DAY', '04-02'); | |
/** | |
* 「年度」を取得する | |
* | |
*/ | |
function get_annual_year(DateTime $date) { |
This file contains hidden or 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 | |
if [ $# -ne 1 ]; then | |
echo "warn: need a url" | |
exit 1 | |
fi | |
#正体はただのaliasでした! | |
wget --no-host-directories -r -np $1 |
This file contains hidden or 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 bash | |
# @see http://qiita.com/miya0001/items/4dc5949dd792963ef578 Thanks! | |
# Usage: ssh [email protected] | |
# Automatically adds `-i [email protected]` argument for `ssh` command. | |
# test: bash -c 'source ssh_bash.bash; ssh [email protected] ls' | |
function ssh { | |
local HOSTSTR |
This file contains hidden or 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 ( ! class_exists( 'RecommendPost' ) ) { | |
class RecommendPost { | |
static function init() { | |
add_action( 'admin_menu', array( __CLASS__, 'add_meta_box' ) ); | |
add_action( 'save_post', array( __CLASS__, 'save_meta_data' ) ); | |
add_action( 'pre_get_posts', array( __CLASS__, 'change_order' ) ); | |
} |
This file contains hidden or 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
// https://codex.wordpress.org/Transients_API | |
// kショートコードをsキャッシうュるコード | |
add_shortcode('someshortcode', function() { | |
echo 'hoge'; | |
}); | |
add_shortcode('someshortcode_cached', function() { | |
if ( $ret = get_transient('someshortcode') ) { | |
return $ret; |
This file contains hidden or 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 bash | |
if [ $# -lt 3 ]; then | |
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]" | |
exit 1 | |
fi | |
DB_NAME=$1 | |
DB_USER=$2 | |
DB_PASS=$3 |
OlderNewer