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('Services/Twilio.php'); | |
function twilio_call(){ | |
$account_sid = ""; | |
$auth_token = ""; | |
$from_num = "+81"; | |
$to_num = "+81"; | |
$twiml_url = ""; | |
$client = new Services_Twilio($account_sid, $auth_token); |
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
<!-- 呼び出し部分 --> | |
<layout-header | |
title="Quick Start Sample" | |
desc="Here is Initial Sample Pages."> | |
</layout-header> | |
<!-- コンポーネント --> | |
<dom-module id="layout-header"> | |
<template> |
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', 'sparql_hooks'); | |
add_action('save_post', 'save_sparql'); | |
add_action('wp_footer','insert_custom_js'); | |
function get_sparql_data(){ | |
$sparql = get_post_meta(get_the_ID(), '_sparql', true); | |
$sparql = urlencode($sparql); | |
$sparql_url = "http://ja.dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fja.dbpedia.org&query={$sparql}&format=application%2Fsparql-results%2Bjson&timeout=0"; | |
return $sparql_url; |
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 | |
/* | |
Plugin Name: CloudFront Host Fix | |
Plugin URI: | |
Description: CloudFront & Nginx Reverse Proxy Cache fix. | |
Version: 0.1 | |
Author: | |
Author URI: | |
*/ | |
add_action('redirect_canonical', 'change_requested_url'); |
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
#!/bin/bash | |
INSTANCEID=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/instance-id` | |
VHOSTS_DIR='/var/www/vhosts' | |
cd $VHOSTS_DIR | |
mkdir $INSTANCEID | |
cd $INSTANCEID | |
mkdir "wp-content" | |
cd "wp-content" | |
mkdir 'mu-plugins' | |
cd 'mu-plugins' |
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
#!/bin/sh | |
wp_url="http://YOUR-SITE.DOMAIN/wp-json/wp/v2/posts" | |
es_url="https://search-YOUR-DOMAIN-XXXXXX.ap-northeast-1.es.amazonaws.com/wp/posts/" | |
filename="sample.json" | |
wget -O ${filename} ${wp_url} | |
posts=$(cat ${filename} | jq ".[].id") | |
count=0 | |
for post in ${posts}; do | |
echo ${es_url}${post} | |
cat ${filename} | jq ".[${count}]" > "${count}.json" |
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
#!/bin/sh | |
URL=${1} | |
if [ "${URL}" = "" ]; then | |
echo "Please set URL" | |
exit 1 | |
fi | |
curl -XGET ${URL}"wp-json/wp/v2/posts" | jq ".[0].title.rendered" | cowsay |
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
{ | |
"formatVersion": "v1.0", | |
"disclaimer": "This pricing list is for informational purposes only. All prices are subject to the additional terms included in the pricing pages on http://aws.amazon.com. All Free Tier prices are also subject to the terms included at https://aws.amazon.com/free/", | |
"publicationDate": "2016-01-07T05:56:50Z", | |
"offers": { | |
"AmazonS3": { | |
"offerCode": "AmazonS3", | |
"versionIndexUrl": "/offers/v1.0/aws/AmazonS3/index.json", | |
"currentVersionUrl": "/offers/v1.0/aws/AmazonS3/current/index.json" | |
}, |
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
payload.logEvents.forEach(function(logEvent) { | |
var timestamp = new Date(1 * logEvent.timestamp); | |
// index name format: cwl-YYYY.MM.DD | |
var indexName = [ | |
'cwl-' + timestamp.getUTCFullYear(), // year | |
('0' + (timestamp.getUTCMonth() + 1)).slice(-2), // month | |
('0' + timestamp.getUTCDate()).slice(-2) // day | |
].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
#!/bin/bash | |
if [ $# -ne 3 ]; then | |
echo "Usage: $0 [AlarmName] [Region] [Profile]" | |
echo "Region: ap-northeast-1 ap-southeast-1 ap-southeast-2 eu-central-1 eu-west-1 sa-east-1 us-east-1 us-west-1 us-west-2" | |
exit | |
fi | |
NAME=$1 | |
METRIC_NAME=StatusCheckFailed_System |