Skip to content

Instantly share code, notes, and snippets.

View morishin's full-sized avatar
🦍
ウホホ

Shintaro Morikawa morishin

🦍
ウホホ
View GitHub Profile

Slack Slash Command

API Gateway

Body Mapping Template for API Gateway (Slack Slash Command -> Lambda)

Slack Slash Command (application/x-www-form-urlencoded) -> API Gateway -> Lambda (application/json)

2017-01-09 12 27 45

function peco-select-git-checkout() {
local selected_branch="$(git branch --sort=-committerdate | grep -v '^\*.*' | peco --query "$LBUFFER" | awk -F ' ' '{print $1}')"
if [ -n $selected_branch ]; then
BUFFER="git checkout $selected_branch"
CURSOR=$#BUFFER
zle accept-line
fi
}
zle -N peco-select-git-checkout
bindkey "^gc" peco-select-git-checkout
module Lib
( generatePoem
) where
import Prelude hiding (Word)
import Control.Monad (join)
import qualified Data.Map as Map
import System.Random (randomRIO)
import Data.Maybe (isNothing, fromMaybe, fromJust)
import Data.List (intercalate)
FROM python:3
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y libfreetype6-dev libatlas-base-dev liblapack-dev gfortran cron
RUN pip install matplotlib
RUN pip install pandas
RUN pip install bottle
@morishin
morishin / task.py
Last active September 27, 2016 15:34
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import json
import os
import sqlite3
import time
import urllib.request
@morishin
morishin / chart.py
Last active September 27, 2016 15:34
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sqlite3
import time
from enum import Enum
from bottle import request, response, route, run, static_file
alias activate='f=`find . -regex ".*/bin/activate"`; source $f'
function send_yo() {
curl -s -d "api_token=API_TOKEN" -d "username=$1" http://api.justyo.co/yo/
}
function yome() {
if [ $# -gt 0 ]; then
for arg in $@
do
send_yo $arg > /dev/null
done
from __future__ import print_function
import sys
def spinner_gen():
while 1:
yield '|'
yield '/'
yield '-'
yield '\\'