WordPress のテスト環境を構築する。
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 | |
/** | |
* Array to Text Table Generation Class | |
* | |
* @author Tony Landis <[email protected]> | |
* @link http://www.tonylandis.com/ | |
* @copyright Copyright (C) 2006-2009 Tony Landis | |
* @license http://www.opensource.org/licenses/bsd-license.php | |
*/ | |
class ArrayToTextTable |
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
# 初期設定 | |
dir = '/home/<your_id>/public_html/www/<your_wp_dir>/' | |
filename = 'wp-login.php' | |
size = 12 | |
original_file = dir + filename | |
# 指定されたディレクトリに、指定されたファイルがあるか探す | |
if File.exist?(original_file) | |
# あれば リネームする | |
rename = [*1..9, *'A'..'Z', *'a'..'z'].sample(size).join + '_' |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
require 'mysql' | |
require 'inifile' | |
# 設定 | |
mycnf = IniFile.load('/home/****/.my.cnf')['client'] | |
sqls = { | |
default: "SELECT id FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' AND post_content LIKE '%[short-code%';" | |
} | |
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
# Make sure using latest Homebrew | |
update | |
# Update already-installed formula | |
upgrade | |
# Add Repository | |
# tap homebrew/versions | |
# tap homebrew/binary |
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
# 少し凝った zshrc | |
######################################## | |
# 環境変数 | |
export LANG=ja_JP.UTF-8 | |
# 色を使用出来るようにする | |
autoload -Uz colors | |
colors |
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
require 'xmlrpc/client' | |
require 'pp' | |
# | |
# Backlog の設定情報 | |
# | |
# Backlog URI のサーバー名 | |
SPACE = 'スペース名' |
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 | |
require 'optparse' | |
# default options | |
USER = 'Tom' | |
PASSWORD = 'tomtom' | |
SERVER = 'localhost' | |
OPTS = {} |
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
require 'readline' | |
def notification(message, title='Bingo Machine', subtitle='', sound='Glass') | |
[message, title, subtitle, sound].each{|arg| arg.gsub!(/"/, '\\\\\"')} | |
scpt = 'display notification "%s"' % message | |
scpt << ' with title "%s"' % title | |
scpt << ' subtitle "%s"' % subtitle unless subtitle.empty? | |
scpt << ' sound name "%s"' % sound unless sound.empty? |
OlderNewer