Skip to content

Instantly share code, notes, and snippets.

View k-nishijima's full-sized avatar

Koichiro Nishijima k-nishijima

View GitHub Profile
@k-nishijima
k-nishijima / main.go
Created June 5, 2020 06:20
301でリダイレクトするためのLambda関数
package main
import (
"bufio"
"fmt"
"net/http"
"net/url"
"strings"
"github.com/aws/aws-lambda-go/events"
@k-nishijima
k-nishijima / md2csv.go
Last active June 5, 2020 06:05
markdownファイルからWebflow向けCSVファイルを生成
package main
import (
"bufio"
"bytes"
"encoding/csv"
"fmt"
"io/ioutil"
"os"
"path/filepath"
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"
"time"
export CHECK_AWS_PROFILE="yourProfile"; declare -a name=("eu-north-1" "ap-south-1" "eu-west-3" "eu-west-2" "eu-west-1" "ap-northeast-2" "ap-northeast-1" "sa-east-1" "ca-central-1" "ap-southeast-1" "ap-southeast-2" "eu-central-1" "us-east-1" "us-east-2" "us-west-1" "us-west-2") ; for i in ${name[@]} ; do aws --profile=$CHECK_AWS_PROFILE --region=$i lambda list-functions | jq -r '.Functions[] | [.FunctionName, .Runtime, .FunctionArn] | @csv' | sort -t "," -k 2 ; done
const express = require('express');
const morgan = require('morgan');
const app = express();
app.use(morgan('combined'));
app.get(
'*',
(_, response) => {
response.setHeader('Content-Type', 'application/json');
response.send(JSON.stringify({ msg: 'hello world' }));
wget http://bit.ly/sagemaker-notebooks -O sagemaker-notebooks.zip
unzip sagemaker-notebooks.zip
@k-nishijima
k-nishijima / matometest.go
Created February 17, 2017 08:49
ファイル名渡してテストメソッドをまとめるテストメソッドを出力する
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
"os"
"strings"
)
@k-nishijima
k-nishijima / gist:cbc085c401f72858278166263bba19ce
Created October 13, 2016 08:00
bashでpecoをお使いの皆様へ
function pcd {
local dir="$( find $GOPATH/src -maxdepth 3 -type d | peco )"
if [ ! -z "$dir" ] ; then
cd "$dir"
fi
}
package main
import (
"fmt"
"os"
"strconv"
"time"
)
func main() {
@k-nishijima
k-nishijima / workshop-promo.md
Last active February 18, 2016 23:17
JAWS DAYS 2016 Workshopトラックへのお誘い

JAWS DAYS 2016 Workshopトラックへのお誘い

JAWS DAYS 2016にご参加の皆様こんにちは! JAWS-UG沖縄の西島と申します。

本日は、初心者のかたから経験者の猛者までが楽しく&新しい発見に満ちた、AWSの活用方法を実際に手で動かして体験できる Workshop トラックのご紹介をします!

このトラックでは明日からすぐに使える、AWSの活用方法を実際に手を動かしながら学ぶハンズオンを開催します。講師及びボランティアスタッフがチームを組んでサポートしますので、初心者の方でも安心です!

ただし、必要なものや事前準備がありますので、それを踏まえた上で各セッションにご参加ください。