Skip to content

Instantly share code, notes, and snippets.

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": [
"events.amazonaws.com",
"ec2.amazonaws.com"
]
{
"ExportJobResponse": {
"CreationDate": "2020-07-04T06:21:41.606Z",
"Definition": {
"RoleArn": "arn:aws:iam::999999999999:role/s3ExportRole",
"S3UrlPrefix": "s3://バケット名/Exports/"
},
"Id": "22d2e2f2452d4645558111333ada506c",
"JobStatus": "CREATED",
"Type": "EXPORT"
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Allow",
"Principal":{
"Service":"pinpoint.amazonaws.com"
},
"Action":"sts:AssumeRole"
}
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUserToSeeBucketListInTheConsole",
"Action": [
"s3:ListAllMyBuckets",
"s3:GetBucketLocation"
],
"Effect": "Allow",
const str = "/var/db/hoge/test1/Android.json";
let regexp = /\/var\/db\/hoge\/(.*?)\/(iPhone|Android)\.json/g;
console.log(regexp.test(str)) // true
console.log(regexp.exec(str)) // nullになってしまう
PUT http://localhost:8080/hoge-0.0.1-SNAPSHOT/employees/12345
Content-Type: application/json
{
"id": "12345",
"name": "takahashi"
}
package jp.co.confrage;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(WarApplication.class);
}
$response = new Phalcon\Http\Response();
// $recordがexecuteQueryメソッドの戻り値
if ($record === false) {
$response->setStatusCode(404); 
$response->setJsonContent(
[
'status' => 'NOT-FOUND'
]
);
} else {
<?php
declare(strict_types=1);
error_reporting(E_ALL);
// オートローダー設定
$loader = new Phalcon\Loader();
$loader->registerNamespaces(
[
'App\Models' => __DIR__ . '/models/',
]
function () use ($app) {
$body = $app->request->getJsonRawBody(); // リクエストボディを受け取る
$status = $app
->modelsManager
->executeQuery(
'INSERT INTO App\Models\Empuser (id, firstname, lastname, age) VALUES ' .
'(:id:, :firstname:, :lastname:, :age:) ',
[
'id' => $body->id,
'firstname' => $body->firstname,