Skip to content

Instantly share code, notes, and snippets.

View y13i's full-sized avatar
☘️

Yoriki Yamaguchi y13i

☘️
View GitHub Profile
@y13i
y13i / generic_aws_network.yml
Last active February 13, 2021 11:18
Generic AWS VPC Networking Template
Description: Generic AWS VPC Networking
Parameters:
PrivateToInternetAccess:
Type: String
Description: If true, NAT Gateways and Elastic IPs will be created for the internet access from private subnets.
AllowedValues:
- "false"
- "true"
Default: "false"
CidrPrefix:
// workaround: when webpack resolve.alias not working
import * as VueAll from "vue";
import VueDefault from "vue";
export type Vue = VueDefault;
export const Vue = <typeof VueDefault><any>VueAll;
import * as VueRouterAll from "vue-router";
import VueRouterDefault from "vue-router";
export type Router = VueRouterDefault;
@y13i
y13i / passgen.js
Last active December 11, 2017 11:30
generate password
new Array(20).fill(undefined).map(() => {const chars = 'qwertyuiopasdfghjklzxcvbnm1234567890!@#$%^&*()-_=+[{]};:/?'.split(''); return chars[Math.floor(Math.random() * chars.length)]}).join('');
@y13i
y13i / .angular-cli.json
Last active December 8, 2017 01:51
AWS Lambda で Angular アプリを Server Side Rendering してみる ref: https://qiita.com/y13i/items/9401f8aeab096a727417
// ...
"apps": [
{
"platform": "browser",
"root": "src",
"outDir": "dist/browser",
// ...
{
"platform": "server",
"root": "src",
@y13i
y13i / file0.swift
Last active August 10, 2017 00:45
Swift 3 で16進数文字列と整数の相互変換 ref: http://qiita.com/y13i/items/9af41a1cb507a4b388e0
String(42, radix: 16) // => "2a"
4 |-------|-------|-------|-------
8 |---|---|---|---|---|---|---|---
16 |-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-
32 ||||||||||||||||||||||||||||||||
*** * *** * *** * *** * *** * **
* * *** * *** * *** * *** * ***
* *** * *** * *** * *** * *** *
@y13i
y13i / file0.txt
Created July 3, 2017 19:06
AWS Price List API から価格情報を引いてくるツールを作った ref: http://qiita.com/y13i/items/ba8f85237e96a5c72ca5
$ awsprice listOfferRegions -o AmazonEFS
[]awsprice.RegionCode{
"ap-southeast-2",
"eu-west-1",
"us-east-1",
"us-east-2",
"us-west-2",
}
@y13i
y13i / ec2ZatsuPrice.js
Last active June 28, 2017 02:19
AWS Price List API で雑に月額を出してみる ref: http://qiita.com/y13i/items/b296844486363946d400
const region = process.env["AWS_REGION"] || "us-east-1";
const instanceType = process.env["INSTANCE_TYPE"] || "c4.large";
const tenancy = process.env["TENANCY"] || "Shared";
const operatingSystem = process.env["OPERATING_SYSTEM"] || "Linux";
const offerType = process.env["OFFER_TYPE"] || "OnDemand";
// ↑フィルター条件をenvで指定してね
const axios = require("axios");
@y13i
y13i / file0.txt
Last active June 24, 2017 09:08
CloudFormation であら便利に静的サイトを作る ref: http://qiita.com/y13i/items/643f7dfd989c6df81d2e
$ aws s3 sync s3://cfn-staticweb-example/ .
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+a",
"command": "cursorHome",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+a",
"command": "cursorHomeSelect"