Skip to content

Instantly share code, notes, and snippets.

@tamanugi
tamanugi / .travis.yml
Created February 20, 2017 15:29
[メモ] TravisCIでnpm run buildしてからS3にデプロイしてCloudFrontで配信する ref: http://qiita.com/tamanugi/items/39a52dbb6704cb563657
language: node_js
node_js:
- "6"
before_deploy:
- npm run build
deploy:
provider: s3
bucket: {{bucket名}}
region: ap-northeast-1
endpoint: {{bucket名}}.s3-ap-northeast-1.amazonaws.com
@tamanugi
tamanugi / file0.txt
Created March 10, 2017 13:53
[AWS] 特定のIPアドレスを含むセキュリティグループの一覧を表示する ref: http://qiita.com/tamanugi/items/145d15fb658cc22e419b
$ aws ec2 describe-security-groups \
--filters Name=ip-permission.cidr,Values='xxx.xxx.xxx.xxx/32'
--query 'SecurityGroups[*].{Name:GroupName, Description:Description}'
[
{
"Name": "hoge",
"Description": "from hogehoge"
},
...
@tamanugi
tamanugi / file0.txt
Created March 13, 2017 14:42
静的サイトジェネレーター Hugo をとりあえず試してみた ref: http://qiita.com/tamanugi/items/049dfa5149f5c03bf48d
$ brew install hugo
$ hugo version
ugo Static Site Generator v0.19 darwin/amd64 BuildDate: 2017-02-27T19:21:29+09:00
@tamanugi
tamanugi / GoogleCalendarSyncSlackStatus.gs
Last active May 2, 2017 13:59
GASを使ってGoogle CalendarとSlack Statusを同期する ref: http://qiita.com/tamanugi/items/1c083dac5d35f65092d9
var calendarId = "Calendar ID を入力";
var slackToken = "Slack API Token を入力"
function onTrigger() {
var event = getCurrentEvent(calendarId);
updateSlackStatus(event);
}
@tamanugi
tamanugi / file0.txt
Last active May 8, 2017 01:29
[Git]カレントブランチをブランチ名を指定せずにプッシュする ref: http://qiita.com/tamanugi/items/e9e4ef6c2c492d841499
$ git push origin HEAD
@tamanugi
tamanugi / file0.txt
Created April 27, 2017 14:35
ゆたぽんフォントにPowerlineパッチをあてる ref: http://qiita.com/tamanugi/items/16409fe0a00a0a54d3a3
$ brew install fontforge
@tamanugi
tamanugi / erastosthenes.exs
Last active May 18, 2017 05:05
Elixirでエラトステネスの篩を実装してみた ref: http://qiita.com/tamanugi/items/8b97e93f94fdb014100b
defmodule Erastosthenes do
def sieve(prime, next, last?) do
receive do
n when rem(n, prime) == 0 ->
sieve(prime, next, last?)
n ->
send next, n
next = if last? do
# 自身が最後の篩だったら次の篩を生成する
@tamanugi
tamanugi / gist:9207b0f67f4c383c45de1004cdbf4ad6
Created June 14, 2017 06:24
Git log から任意のコミットハッシュを取得
git log --full-history --date=format:'%Y/%m/%d %H:%M:%S' --pretty=format:'%h [%ad] %an : %s' | peco | awk '{print nt $1}'
@tamanugi
tamanugi / mix.exs
Last active June 26, 2017 04:24
wikipediaのhttpstatusからスクレイピングを行う
defmodule ScrapingWikiHttpstatus.Mixfile do
use Mix.Project
def project do
[app: :scraping_wiki_httpstatus,
version: "0.1.0",
elixir: "~> 1.4",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
elixirc_paths: ["."],
for line in (cat syukujitsu_utf8.csv)
set -l syuku (string split , $line)
echo "$syuku[1]は$syuku[2]です"
end