Skip to content

Instantly share code, notes, and snippets.

View pddg's full-sized avatar
🏠
Working from home

Shoma Kokuryo pddg

🏠
Working from home
View GitHub Profile
@pddg
pddg / config.py
Created February 2, 2019 13:34
config file for xkeysnail
# -*- coding: utf-8 -*-
import re
from xkeysnail.transform import *
define_keymap(None, {
K('C-h'): Key.LEFT,
K('C-j'): Key.DOWN,
K('C-k'): Key.UP,
K('C-l'): Key.RIGHT,
@pddg
pddg / csv2md.fish
Last active December 14, 2018 01:26
https://github.com/monochromegane/mdt を使ってcsvをmdのtableに変換するfishの関数(gzip対応版)
function csv2md
function usage
echo "Description: Convert csv file to table in markdown format."
echo "Usage: csv2md [-z] FILE"
echo "Options and arguments:"
echo -e "\t-z\t: Uncompress gzip archived csv"
echo -e "\tFILE\t: Path to CSV file"
end
set command "cat"
@pddg
pddg / kp_exporter.py
Created October 4, 2018 09:13
Help to migrate KeePass compatible database to 1Password
import argparse
import codecs
import csv
import pathlib
# Default: "Group","Title","Username","Password","URL","Notes"
ideal_header = ["Title", "URL", "Username", "Password", "Notes", "Group"]
def main():
parser = argparse.ArgumentParser(description="Make CSV exported from KeePassX compatible with 1Password.")
@pddg
pddg / .cvimrc
Last active October 13, 2018 07:00
cVim configurations
set noautofocus
set smoothscroll
set typelinkhints
let searchlimit = 30
let scrollstep = 100
set nativelinkorder
" set showtabindices
set completeonopen
@pddg
pddg / multithread.go
Last active April 27, 2018 03:48
Leibniz in Go
package main
import (
"fmt"
"math"
)
func main() {
const MAX = 4
const N = 100000000
@pddg
pddg / config.json
Created January 15, 2018 16:06
任意のWiFi接続・切断時に任意のシェルスクリプトを実行するHammerspoonの設定
{
"base": {
"notify": false,
"shell": "/bin/bash",
"with_user_env": true
},
"networks": [
{
"SSID": "ssid1",
@pddg
pddg / output
Last active July 10, 2017 14:14
Subprocess stdout
$ python -V
3.6.0
$ python sub_stdout.py
Execute: echo 'test'
Result: test
<class 'str'>
@pddg
pddg / api.py
Created May 15, 2017 15:04
iTunesAPI sample
from urllib.request import urlopen
import json
res = urlopen("https://itunes.apple.com/search?term=beatles&media=music&entity=album&country=jp")
j = json.loads(res.read().decode("utf-8"))
for i, result in enumerate(j["results"]):
print(i, result["collectionName"])
@pddg
pddg / .vimrc
Last active October 20, 2015 03:17
pudding's .vimrc
" release autogroup in MyAutoCmd
augroup MyAutoCmd
autocmd!
augroup END
"-----------表示設定----------
set number "行番号表示
set showmatch "括弧入力時の対応する括弧を表示
syntax on "コードの色分け
set matchtime=3 "ハイライト時間を3秒に