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
function custom_user_profile( $user ) { | |
//以下カスタムプロフィールの追加フォーム | |
?> | |
<table id="custom_user_field_table" class="form-table"> | |
<tr id="custom_user_field_row"> | |
<th> | |
<!--項目名--> | |
<label for="custom_field"><?php _e('Field'); ?></label> | |
</th> | |
<td><!--追加のフォームはここ--> |
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
add_filter('manage_media_columns', 'columns_head'); | |
add_filter('manage_media_custom_column', 'columns_content', 10, 2); |
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
LoadModule evasive20_module modules/mod_evasive20.so | |
<IfModule mod_evasive20.c> | |
DOSHashTableSize 3097 | |
#1秒間に何回同じページにアクセスされたら | |
DOSPageCount 5 | |
#1秒間に何回サイトにアクセスされたら | |
DOSSiteCount 30 | |
#1秒間でのページアクセス | |
DOSPageInterval 1 | |
#1秒間でのサイトアクセス |
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
function my_jquery($hook) { | |
if($hook == 'edit.php'){ | |
wp_enqueue_script('custom_admin_script', get_bloginfo('template_url').'/js/my_jquery.js', array('jquery')); | |
} | |
} | |
add_action('admin_enqueue_scripts', 'my_jquery'); | |
//jQueryでない場合、 wp_enqueue_scriptの第三引数は不要です。 |
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
function my_jquery($hook) { | |
if($hook == 'edit.php'){ | |
global $post; | |
if ( $hook == 'post-new.php' || $hook == 'post.php' ) { | |
if ( 'custom_post_name' === $post->post_type ) { | |
wp_enqueue_script('custom_admin_script', get_bloginfo('template_url').'/js/my_jquery.js', array('jquery')); | |
} | |
} | |
} | |
} |
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 | |
//cakephpチックに書くとこんな感じ? | |
//cakephpでなければ適当にfunctions のところだけ抜き出して使ってください | |
App::uses('AppModel', 'Model'); | |
class Counter extends AppModel { | |
public function connect() { | |
$client = new MongoClient(); | |
$db = $client->selectDB('databaseName'); | |
return $db; | |
} |
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
$itemid = $this->Counter->seq('itemid'); | |
$itemArray = [ "_id" => $itemid['value']['seq'], | |
"title" => 'hogehoge', | |
"user_id" => 1, | |
"created" => date('Y-m-d H:i:j'), | |
]; | |
function add($itemArray) { | |
$client = new MongoClient(); | |
$db = $client->selectDB('databaseName'); |
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
[mongodb-org-3.2] | |
name=MongoDB Repository | |
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/ | |
gpgcheck=0 | |
enabled=1 |
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
● MongoDBインストール | |
yum install mongodb-org | |
●自働起動 | |
chkconfig mongod on | |
●epelリポジトリ | |
yum install -y epel-release | |
●wget インストチェック |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |