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\CognitoIdentity\CognitoIdentityClient; | |
use Aws\Sts\StsClient; | |
use Aws\S3\S3Client; | |
$facebook = new Facebook(array( | |
'appId' => '<facebookのappid>', | |
'secret' => '<facebookのsecret>', | |
)); |
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( 'wpmu_new_blog', function($blog_id) { | |
//マルチサイトの親のお問い合わせデータを取ってくる | |
switch_to_blog(1); | |
$trust_form = get_posts( array('post_type'=>'trust-form') ); | |
if ( empty($trust_form) ) { | |
return; | |
} |
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'); | |
function startInstance(instance_id, context) { | |
var ec2 = new AWS.EC2(); | |
var params = { | |
InstanceIds: [ | |
instance_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
var AWS = require('aws-sdk'); | |
function ISODateString(d){ | |
function pad(n){return n<10 ? '0'+n : n} | |
return d.getUTCFullYear()+'-' | |
+ pad(d.getUTCMonth()+1)+'-' | |
+ pad(d.getUTCDate())+'T' | |
+ pad(d.getUTCHours())+':' | |
+ pad(d.getUTCMinutes())+':' | |
+ pad(d.getUTCSeconds())+'Z' |
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
- (IBAction)startInstance:(id)sender { | |
LAContext *myContext = [[LAContext alloc] init]; | |
NSError *error = nil; | |
// 端末が指紋認証を使えるかどうか判定 | |
if([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) { | |
NSString *myLocalizedReasonString = @"指紋認証せんかい!"; | |
[self.activityIndicator startAnimating]; | |
// 指紋認証画面を表示 | |
[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics |
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 Elastica\Client; | |
use Elastica\Query; | |
use Elastica\Query\QueryString; | |
add_action( 'pre_get_posts', function($query){ | |
if ( $query->is_search() && $query->is_main_query() ) { | |
$client = new \Elastica\Client(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
{ | |
"Parameters":{ | |
"InstanceType": { | |
"Description": "EC2 instance type", | |
"Type": "String", | |
"Default": "t2.small", | |
"AllowedValues": [ | |
"t2.small", | |
"t2.medium", | |
"t2.large", |
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 path = require('path'), | |
chai = require('chai'), | |
should = chai.should(), | |
Serverless = require('serverless') | |
describe('ServerlessProjectTest', function() { | |
beforeEach(function(done) { | |
this.timeout(0); | |
s = new Serverless(); |
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
service: horike-service | |
provider: aws | |
functions: | |
hello: | |
handler: handler.hello | |
events: | |
- http: | |
path: hello | |
method: GET | |
resources: |
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
'use strict'; | |
const AWS = require('aws-sdk'); | |
const BbPromise = require('bluebird'); | |
class AwsProvider { | |
request(service, method, params) { | |
const awsService = new AWS[service](); | |
const req = awsService[method](params); |