Skip to content

Instantly share code, notes, and snippets.

@K4zuki
K4zuki / README.md
Last active July 5, 2020 04:22
ubuntu16.04-like bashrc with git status

ubuntu16.04-like bashrc with git status

install

  1. clone to ~/git_bashrc
  2. find out git-prompt.sh and git-completion.bash and add source line in git_bashrc/bashrc
  3. $ echo "source ~/git_bashrc/bashrc" > ~/.bashrc

look

user@localhost:~/git_bashrc (master *) $
<-- green --><-- blue --> <-- white-->
@K4zuki
K4zuki / bcd-counter-7seg.gp6
Last active August 7, 2019 11:49
BCD-counter+7-seg-decoder+carry-out circuit using GreenPAK SLG46826G(TSSOP)
<?xml version="1.0" encoding="UTF-8"?>
<GPDProject version="9" oldestCompatibleVersion="9" GPDVersion="6.19.004" lastChange="2019/08/07 1:40">
<generalProjectSettings/>
<chip family="04" type="06" friendlyName="GreenPAK 6" partNumber="36" package="16">
<nvmData registerLenght="2048">12 90 39 EB B5 A6 9C 14 6D 8E BF 69 FE 96 F9 1B E6 AB 56 FA 47 1 60 55 D4 4 0 51 45 4D 56 45 59 15 65 55 94 55 51 56 45 5 1A 0 0 0 0 0 0 0 0 40 10 0 0 0 0 40 7 F9 A7 EF FA 8F DF FA AC 7F F9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 80 30 30 30 0 0 30 80 3 0 3 3 3 3 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14 22 30 C 0 0 0 0 0 0 0 15 71 0 0 40 0 0 10 0 15 D0 2B 78 6E 0 0 0 71 73 20 0 1 0 2 0 43 1F 0 1 2 0 1 0 10 2 1 0 80 2 0 1 0 9F 2 1 0 FB 2 0 1 0 45 2 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A5</nvmData>
<checksum crc32="0x1A16B46A" version="7"/>
<asmModel>
<stateMachine>
<asmMode
@K4zuki
K4zuki / use-lupa.md
Created July 10, 2019 05:12
use-lupa.md

get lupa package

apk add py3-lupa
apt install python3-lupa

use lupa to get lua module search paths

@K4zuki
K4zuki / note.md
Last active May 27, 2019 19:32
can make a hg repo as git submodule?

Idea

  • clone a mbedTM repository as mercurial repo
  • put the cloned repo to github(or similar) as a git repo with mbed repo revision status history
  • another git repo uses the converted github repo as a submodule

Hints

@K4zuki
K4zuki / docx_colspan.py
Last active April 30, 2019 13:57
Table column spanning post processor for a docx file
import docx
"""
Col span
+----+----+----+----+
|hoge|piyo|foo |bar |
+----+----+----+----+
|baz | |foo |bar |
+----+----+----+----+
@K4zuki
K4zuki / docx_property.py
Created November 14, 2018 09:40
docx_property.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Do nothing but get properties from a docx
requires python-docx >= 0.8.6
MIT licence (c) Kazuki Yamamoto (k.yamamoto.08136891@gmail.com)
"""
import docx
doc = docx.Document(outfile)
@K4zuki
K4zuki / listing_test.py
Last active November 6, 2018 05:35
change attributes of code block inside `pandoc-crossref` listing div
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
python3.5 works as-is
json lib does not work as expected with python2.7
seems utf-8 string related
pandoc -t docx -o <docx filename> <input filename>
--filter=pandoc-crossref --filter=./listing_test.py
"""
@K4zuki
K4zuki / github.css
Last active September 22, 2018 14:08
a fork of Super Famous github.css
body {
font-family: Source Han Sans L, Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@K4zuki
K4zuki / note.md
Last active August 28, 2018 15:51
python and Make to generate a scatter plot from csv file
@K4zuki
K4zuki / note.md
Created May 24, 2017 08:42
install docxtpl on your local [WINDOWS]
$ conda skeleton pypi docxtpl
$ conda build docxtpl
$ conda install --use-local docxtpl