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 | |
/** | |
* Tokenize string to morphemes. | |
* | |
* @param string $string | |
* @return array | |
*/ | |
function hametuha_punctuate( $string ) { | |
try { |
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/env bash | |
set -e | |
echo "Compiling $1/$2..." | |
cd ~/Downloads | |
mkdir tmp | |
cd tmp | |
git clone [email protected]:$1/$2.git | |
cd $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
<?php | |
/** | |
* Regsiter script | |
*/ | |
add_action( 'wp_enqueue_scripts', function() { | |
// Set dependency to wp-api, which has nonce and endpoint root. | |
wp_enqueue_script( 'api-handler', '/path/to/api-handler.js', [ 'jquery', 'wp-adpi' ], '1.0', true ); | |
} ); |
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
{ | |
"entities": [ | |
{ | |
"name": "村田沙耶香", | |
"type": "PERSON", | |
"metadata": { | |
"wikipedia_url": "http://ja.wikipedia.org/wiki/%E6%9D%91%E7%94%B0%E6%B2%99%E8%80%B6%E9%A6%99" | |
}, | |
"salience": 0, | |
"mentions": [ |
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 | |
/** | |
* ゲンロンSF講座の落選者実作を取得する | |
* | |
* simple_html_dom.phpをダウンロードして、同じフォルダに置いてください。 | |
* https://sourceforge.net/projects/simplehtmldom/files/ | |
* | |
* @example | |
* php list.php http://school.genron.co.jp/works/sf/2016/subjects/definition/ | |
*/ |
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( 'rest_api_init', function(){ | |
register_rest_route( 'tweeter/v1', '/friends/(?P<user_id>[0-9]+)/?', [ | |
[ | |
'methods' => 'POST', | |
'callback' => function($params){ |
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 | |
# ID1でログインする | |
include __DIR__.'/wp-load.php'; | |
wp_set_auth_cookie(1); | |
header( 'Location: '.admin_url() ); | |
exit; |
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
update tweeter_usermeta set meta_key = 'tweeter_capabilities' where meta_key = 'wp_capabilities'; | |
update tweeter_options set option_name = 'tweeter_user_roles' where option_name = 'wp_user_roles'; |
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
on run {input, parameters} | |
tell application "Pages" | |
activate | |
open input | |
tell front document | |
-- GET ALL TAGS | |
set theseTags to the tag of every placeholder text | |
-- FILTER FOR UNIQUE TAGS |
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 | |
/** | |
* A template loader which accepts arguments. | |
* | |
* @param string $slug | |
* @param string|array $name | |
* @param array $args Arguments to pass. | |
* @param bool $echo If false, return string. | |
* @param string $glue Default is '-'. You can specify '/' which means directory separator. | |
* |