Skip to content

Instantly share code, notes, and snippets.

View pyar6329's full-sized avatar

Tsukasa Arima pyar6329

View GitHub Profile
@pyar6329
pyar6329 / .tigrc
Created February 15, 2023 01:54
Tig config
# 左にコミットIDを表示する
set main-view = id date author commit-title:graph=yes,refs=yes
# 左に行数を表示する
set blame-view = date:default author:email-user id:yes,color line-number:yes,interval=1 text
# Pager系の行数表示をON、intervalを1に (default: line-number:no,interval=5)
set pager-view = line-number:yes,interval=1 text
set stage-view = line-number:no,interval=1 text
set log-view = line-number:yes,interval=1 text
PostgreSQL Type PostgreSQL Size Description Range Diesel Type Rust Type
Nullable Types nullable Nullable``
@pyar6329
pyar6329 / main.py
Created June 3, 2021 12:05
base64 URL encoding vs URL encoding
import json
import random
style = ["Structured", "Plain"]
max_size = 320
dic = {i: style[random.randint(0, 1)] for i in range(max_size)}
json_dic = json.dumps(dic,ensure_ascii=False)
print(json_dic)
@pyar6329
pyar6329 / docker-compose.yml
Last active March 29, 2019 00:23
CockroachDB 4 clusters
version: '3.7'
services:
cockroach1:
image: cockroachdb/cockroach:v2.1.6
container_name: sample-cockroach-1
command: start --insecure
networks:
sample:
aliases:
- sample-cockroach-1
@pyar6329
pyar6329 / password.elm
Created June 15, 2018 05:35 — forked from moonlightdrive/password.elm
Password Validation Exercises from the Elm Architecture Tutorial
{- Implementation of the Exercises for the Forms section of the Elm Architecture Tut
- http://guide.elm-lang.org/architecture/user_input/forms.html
-
- Elm Platform 0.17.1
-}
import Html exposing (..)
import Html.App as Html
import Html.Attributes exposing (..)
import Html.Events exposing (onInput, onClick)
@pyar6329
pyar6329 / main.elm
Created May 2, 2018 09:07 — forked from maticzav/main.elm
Flatten 2D list in Elm
import List exposing (..)
flatten2D : List (List a) -> List a
flatten2D list =
foldr (++) [] list
-- SAMPLE
flatten2D [[1,2],[3,4],[1,1]] == [1,2,3,4,1,1]
@pyar6329
pyar6329 / destructuring.md
Created May 2, 2018 09:06 — forked from yang-wei/destructuring.md
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@pyar6329
pyar6329 / download_jsdm_report.sh
Created April 17, 2018 07:55
download Japan Self-Defense Forces daily report
#!/bin/bash
# 要 gnu-grep, pget
set -eu
case "$(uname -s)" in
"Darwin")
cpu_cores=$(system_profiler SPHardwareDataType | grep "Total Number of Cores:" | awk '{print $NF}')
;;
"Linux")
@pyar6329
pyar6329 / hhkb_layout.txt
Created January 24, 2018 23:32
Happy Hacking Keyboard layout raw data (http://www.keyboard-layout-editor.com/)
["esc","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=","|\n\\","~\n`"],
[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"Delete"],
[{w:1.75},"Ctrl","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Return"],
[{w:2.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:1.75},"Shift","Fn"],
[{x:1.25,w:1.25},"Option",{w:1.25},"⌘",{a:7,w:6.25},"",{a:4,w:1.25},"⌘",{w:1.25},"Option"]
@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"\""'})