Skip to content

Instantly share code, notes, and snippets.

View 9bic's full-sized avatar
🤓
👐

Takashi Saito 9bic

🤓
👐
  • Japan
View GitHub Profile
@9bic
9bic / cloud-config.yaml
Created January 6, 2018 17:22
gcloud and gsutil for Google Container Optimized OS
#cloud-config
users:
- name: cloudservice
groups: docker
uid: 2000
write_files:
- path: /home/cloudservice/currentdir/gcloud-sdk-setup
permissions: '0644'
@9bic
9bic / README.md
Created October 4, 2017 05:17
Deploy netcore to AWS Lambda

How to deploy ASP.NET Core Application for AWS Lambda + API Gateway

Setup and run locally

  1. dotnet new -i Amazon.Lambda.Templates::* (for the first time only)
  2. dotnet new lambda.AspNetCoreWebAPI --name MyFirstApi --profile default --region ap-northeast-1
  3. cd MyFirstApi/src/MyFirstApi
  4. code . or Open Code -> Cmd + O -> Cmd + Shift + G -> input your working directory
  5. add launch.json/tasks.json
  • add configuration -> .NET Core
@9bic
9bic / README.md
Last active July 16, 2024 02:20
Auth0 Custom SMS Gateway for AWS API Gateway

Auth0 Custom SMS Gateway for AWS API Gateway

Auth0 can passwordless(token based) authentication. but in default, SMS verification is used Twilio only. this solution is using auth0 custom connections, to possible SMS verification with AWS SNS and API Gateway.

Deploy

  1. create IAM Role iam-sns-publishable-role and attach inline policy.

    {
    

"Version": "2012-10-17",

@9bic
9bic / playbook for ffmpeg
Last active February 26, 2016 08:20
localhost に ffmpeg をインストールする playbook
- hosts: localhost
user: root
vars:
src_dir: "/usr/local/src/ffmpeg_sources"
tasks:
- name: "install Dependences"
yum: name={{ item }} state=installed
with_items:
- make
@9bic
9bic / server.js
Created April 24, 2015 02:30
Backlog Webhookで受け取った更新をTypetalkに流す
var http = require('http');
var https = require('https');
var fs = require('fs');
var queryString = require('querystring');
// configs
var enableHttps = true;
var port = {
http: 8080,
https: 8443
@9bic
9bic / gist:32954d4cc8f947bb39d6
Created April 22, 2015 10:59
jqコマンドでjsonをフォーマットする関数 in vim
if executable('jq')
function! FormatJson()
execute "%!jq '.'"
set filetype=json
endfunction
nmap <Leader>jf :call FormatJson()<CR>
endif
@9bic
9bic / gist:c2a4473994abaeeef613
Last active August 29, 2015 14:14
DiffMatchPatch in C#
var left = "hoge";
var right = "hoge2";
var dmp = new DiffMatchPatch.diff_match_patch();
var result = dmp.diff_main(left, right);
// as HTML string
var html = dmp.diff_prettyHtml(result);
// as Object
@9bic
9bic / getenfont.ps1
Created December 8, 2014 01:22
フォントの英語名を取得する
Add-Type -AssemblyName System.Globalization
Add-Type -AssemblyName System.Drawing
# get en-US Culture ID
$enCultureId = [System.Globalization.CultureInfo]::GetCultureInfo("en-US").LCID
(New-Object System.Drawing.Text.InstalledFontCollection).Families | % { ("{0} - {1}" -f $_.Name, $_.GetName($enCultureId)) }