Skip to content

Instantly share code, notes, and snippets.

@takashyx
takashyx / itermcolors2hypercolors.py
Last active February 20, 2019 09:25
WIP: convert .itemcolors (theme file for iterm) to colors settings for hyper term (currently 16 ANSI colors only)
import xml.etree.ElementTree as ET
# import pprint
tree = ET.parse('input.itermcolors')
root = tree.getroot()
color_dict = {}
for i in range(len(tree.find("dict"))):
dc = tree.find("dict")[i]
if dc.text.strip().find('Ansi') == 0:
@takashyx
takashyx / Output
Last active February 20, 2019 02:39
decorator to print [filename]:[linenumber] [funcname] start / done
========================================
test.py:11 function myfunc start...
----------------------------------------
myfunc
----------------------------------------
test.py:11 function myfunc done.
========================================
@takashyx
takashyx / .gitconfig
Created April 28, 2016 05:31
Git alias: graph / diff by words
[alias]
# cool branch graph
graph = log --graph --all --date=short --decorate=short --pretty=format:'%Cgreen%h %Creset%cd %Cblue%cn %Cred%d %Creset%s'
# diff by words, not lines
diffs = diff --word-diff
# cool logs
logs = log -p --graph --decorate --pretty=format:\"%ad [%cn] <c:%h t:%t p:%p> %n %Cgreen%d%Creset %s %n\" --stat
# show staged / not staged only (no untracked files)
sts = status -uno
@takashyx
takashyx / Cout2VisualStudioDebugOutput.h
Last active June 23, 2022 05:15
Redirect std::cout to Visual Studio Debug Output
#pragma once
#include <iostream>
#include <Windows.h>
class debugStreambuf : public std::streambuf {
public:
virtual int_type overflow(int_type c = EOF) {
if (c != EOF) {
@takashyx
takashyx / file0.txt
Last active September 5, 2016 11:13
雨が降る・止む30分前にSlackに通知してくれるhubot用スクリプト ref: http://qiita.com/takashyx/items/ccd5ccab7007d43f1355
npm install hubot-slack-rainfall-alert --save
@takashyx
takashyx / .rubocop.yml
Last active August 29, 2015 14:06
.rubocop.yml設定
inherit_from: .rubocop_todo.yml
# 日本語コメント許可
AsciiComments:
Enabled: false
# モジュール名::クラス名定義許可
ClassAndModuleChildren:
Enabled: false