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 | |
add_action('init', 'my_cron_schedule'); | |
function my_cron_schedule() { | |
if ( get_option('my_cron_schedule_locked') == 1 ) | |
return; | |
$crons = _get_cron_array(); | |
foreach ( $crons as $time => $time_cron_array ) { | |
if ( array_key_exists( 'my_cron_schedule_handler', $time_cron_array ) ) { |
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 | |
add_filter( 'tr_subject_admin_mail', 'my_tr_subject_admin_mail', 10, 3 ); | |
function my_tr_subject_admin_mail( $subject, $data, $id ) { | |
$responce = get_post_meta( $id, 'answer' ); | |
krsort($responce); | |
$entry_id = key($responce); | |
return $subject . '[id:'.$entry_id.']'; | |
} |
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 | |
add_action('admin_menu', 'my_plugin_menu'); | |
function my_plugin_menu() { | |
global $my_plugin_page; | |
$my_plugin_page = add_options_page('My Plugin Options', 'My Plugin', 'Administrator', __FILE__, 'my_plugin_options'); | |
add_action("load-$my_plugin_page", my_screen_options); | |
} | |
function my_screen_options() { | |
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
const ACCESS_KEY = '<ACCESS_KEY>'; | |
const SECRET_KEY = '<SECRET_KEY>'; | |
var AWS = require('aws-sdk'); | |
AWS.config.update({accessKeyId: ACCESS_KEY, secretAccessKey: SECRET_KEY}); | |
exports.handler = function(event, context) { | |
var opsworks = new AWS.OpsWorks(); | |
opsworks.describeInstances( {InstanceIds : [event.instance_id]},function(err, data) { | |
if (err) { |
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 | |
require_once( 'wp-load.php' ); //スクリプト設置位置によってパスを変える | |
$users = get_users(); | |
foreach ( $users as $user ) { | |
wp_update_user( array( 'ID' => $user->ID, 'user_email' => $user-> user_email.'.example') ); | |
} |
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
{ | |
"login": { | |
"url":"http://wordpress.local/wp-login.php", | |
"account_id":"admin", | |
"account_pass":"admin" | |
} | |
} |
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
var webdriver = require('selenium-webdriver'); | |
var t = require('selenium-webdriver/testing'); | |
var driver; | |
var By = webdriver.By; | |
var until = require('selenium-webdriver').until; | |
var setting = require('./setting.json'); | |
var fs = require('fs'); | |
var expect = require('expect.js'); | |
var timestamp = Math.floor( new Date().getTime() / 1000 ); |
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
var aws = require('aws-sdk'); | |
var cloudsearchdomain = new aws.CloudSearchDomain({ | |
endpoint: '<CloudSearchのエンドポイント>' | |
}); | |
exports.handler = function(event, context) { | |
var params = { | |
query:event.q | |
}; |
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
var aws = require('aws-sdk'); | |
var machinelearning = new aws.MachineLearning(); | |
var params = { | |
MLModelId: '<Machine LearningのモデルID>' | |
}; | |
exports.handler = function(event, context) { | |
machinelearning.getMLModel(params, function(err, data) { | |
if (err) { | |
console.log(err, err.stack); |
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 | |
require_once("vendor/autoload.php"); | |
Use Aws\MachineLearning\MachineLearningClient; | |
$hash_value = mt_rand(); | |
$client = MachineLearningClient::factory(array('version'=>'2014-12-12','region'=>'us-east-1')); | |
//訓練データ定義 |
OlderNewer