Skip to content

Instantly share code, notes, and snippets.

View pyar6329's full-sized avatar

Tsukasa Arima pyar6329

View GitHub Profile
@pyar6329
pyar6329 / .envrc
Last active May 23, 2018 21:26
direnv loading env_file of docker-compose
eval $(cat "$(pwd)/docker/env/envfile.env" | grep -v "#" | awk -F= {'print "export "$1"=\""$2"\""'})
@pyar6329
pyar6329 / new_phoenix.sh
Created October 24, 2017 02:24
phoenix project generator
function new_phoenix(){
mix archive.install --force https://github.com/phoenixframework/archives/raw/master/phx_new.ez
mix phx.new $1 --no-brunch --no-ecto --no-html --binary-id
}
new_phoenix foobar
array = [ 1, 2, 3, 4, 5 ]
defmodule Functional do
def functional([]), do: []
def functional([head |tail]), do: [ 0 = rem(head, 2) head + 1 | functional(tail)]
def functional([head |tail]), do: [head * 2 | functional(tail)]
def functional(_), do: []
end
IO.puts Functional.functional(array)
@pyar6329
pyar6329 / functional.rb
Created September 29, 2017 04:37
ruby functional vs non functional
def non_functional
array = [0, 1, 2, 3, 4, 5, 6]
output = []
array.each do |a|
if a % 2 == 0
output.push(a + 1)
else
output.push(a * 2)
end
@pyar6329
pyar6329 / FromEscapeToJapanese_eisuu.json
Last active September 21, 2017 06:19
karabiner elements configs (esc, ctrl-g, ctrl-sで日本語入力off)
{
"title": "Terminal等でESCあるいはctrl-gあるいはctrl-sで日本語入力を英数に",
"rules": [
{
"description": "TerminalまたはMacVimでESCあるいはctrl-gあるいはctrl-sを押したときに日本語入力を英数に切り替える。",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
@pyar6329
pyar6329 / minikube.sh
Last active September 15, 2017 05:30
minikube startup
# docker for macを入れる
$ brew install docker-machine-driver-xhyve --without-docker-machine
$ sudo chown root:wheel /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ rm -rf /usr/local/bin/VBox* /usr/local/bin/VirtualBox # virtualbox入れた場合はアンインストールして消す
$ minikube start --vm-driver=xhyve --memory=2048 --cpus=4
$ kubectl config use-context minikube
@pyar6329
pyar6329 / markdown.md
Last active September 14, 2017 07:09
github markdown sample

MultiMarkdown

Headers

This is an

tag

This is an

tag

This is an
tag

Emphasis

@pyar6329
pyar6329 / all_unicode.txt
Created June 23, 2017 09:07
all unicode txt

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§
¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕ
ÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüý
þÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦ
ħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐ
őŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸ
ŹźŻżŽžſƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐƑƒƓƔƕƖƗƘƙƚƛƜƝƞƟƠơƢƣƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿǀǁǂ
ǃDŽDždžLJLjljNJNjnjǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰDZDzdzǴǵǶǷǸǹǺǻǼǽǾǿȀȁ
@pyar6329
pyar6329 / 0_reuse_code.js
Created October 11, 2016 08:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pyar6329
pyar6329 / fullAccessRoles.json
Created October 6, 2016 09:08
aws inline policies fullAccess Roles
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"iam:AddRoleToInstanceProfile",
"iam:AttachRolePolicy",
"iam:CreateInstanceProfile",
"iam:CreateRole",
"iam:DeleteInstanceProfile",