Skip to content

Instantly share code, notes, and snippets.

View ShinichiNishikawa's full-sized avatar
🏠
Working from home

Shinichi Nishikawa ShinichiNishikawa

🏠
Working from home
View GitHub Profile
@kevinelliott
kevinelliott / osx-10.11-setup.md
Last active April 10, 2022 15:47
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

/*
Theme Name: Fictive Child Theme for ja.naoko.cc
Theme URI: http://ja.naoko.cc/
Description: Fictive theme in pink/brown color scheme.
Version: 1.0
Author: Automattic, modified by Naoko Takano
Author URI: http://naoko.cc/
Template: fictive-wpcom
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@morganestes
morganestes / wp-beta-setup.sh
Last active May 15, 2017 07:56
Set up a WordPress site for beta testing with wp-cli.
#!/usr/bin/env sh
# Install the Beta Tester plugin and set it to "Bleeding Edge" releases.
# Note: after installing plugin and setting the option, you may need to visit
# the site once before updating core version.
wp-beta() {
wp plugin install wordpress-beta-tester --activate
wp option set wp_beta_tester_stream unstable
wp core update
add_action( 'admin_footer', function(){
echo <<EOL
<script type="text/javascript">
$('bigger-link').click(function () {
$('.mceContentBody *').css('font-size', $(this).attr('data-fontsize'));
});
</script>
EOL;
@wokamoto
wokamoto / gist:9800905
Created March 27, 2014 05:26
[WordPress] remote_get transient
<?php
function transient_remote_get($url, $expiration = 3600) {
$transient = 'remote_get-' . md5($url);
if ( ! ($response_body = get_transient($transient)) ) {
$response = wp_remote_get($url);
if( !is_wp_error($response) && $response["response"]["code"] === 200 ) {
$response_body = $response["body"];
set_transient($transient, $response_body, $expiration);
} else {
$response_body = false;
@miya0001
miya0001 / gist:6668263
Last active October 9, 2017 05:19
WordPressコアに対するパッチの作り方
========
パッチの作り方
========
$ mkdir wordpress
$ cd wordpress # ここがドキュメントルート
$ svn co http://develop.svn.wordpress.org/trunk/ .
$ svn update # 作業を行う直前に毎回実行!
ファイルを追加した場合は `svn add` でそのファイルを追加する。
@wokamoto
wokamoto / create_snapshot.sh
Last active December 16, 2015 06:49
AWS で、稼働中のインスタンスで自身のEBSボリュームのスナップショットを作るためのシェルスクリプト
#!/bin/sh
export JAVA_HOME="/usr/lib/jvm/jre"
export EC2_HOME="/usr/local/bin/ec2-api-tools"
export EC2_PRIVATE_KEY="~/ec2keys/pk-****.pem"
export EC2_CERT="~/ec2keys/cert-****.pem"
EC2_CMD="${EC2_HOME}/bin"
LOG_FILE="/var/log/create_snapshot.log"
LOG_SAVE_PERIOD=14
@gatespace
gatespace / gist:4108710
Created November 19, 2012 02:52 — forked from tekapo/gist:4108697
最強のテンプレートタグ get_the_khoshino()
<?php
function get_the_khoshino($username == null) {
if (!empty($username)) {
return 'いやいや'.$username.'さんほどでは。';
} else {
return 'やはりですか。なるほどですね。';
}
}
?>
@gatespace
gatespace / post_type_research_add_meta_box.php
Created September 24, 2012 01:47
カスタム投稿タイプAとBを紐づけるメタボックス
<?php
/*
* カスタム投稿タイプ「research」の投稿画面に
* カスタム投稿タイプ「teacher」の投稿一覧のメタボックスを追加する(チェックボックス編)
* teacherの投稿IDをresearchのカスタムフィールド「teacher_ID」に配列で保存
*/
add_action( 'add_meta_boxes', 'add_teacher_list_box' );
function add_teacher_list_box() {
add_meta_box('teacher_list', '教員一覧', 'teacher_list_custom_box', 'research', 'side', 'low');
@markjaquith
markjaquith / disable-plugins-when-doing-local-dev.php
Created June 24, 2011 10:24
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/