Skip to content

Instantly share code, notes, and snippets.

View Drunkar's full-sized avatar

Akio Ohta Drunkar

View GitHub Profile
# coding: utf-8
import logging
import traceback
import argparse
import time
from logging.handlers import RotatingFileHandler
from contextlib import contextmanager
logger = logging.getLogger(__name__)
@Drunkar
Drunkar / bom2csv.py
Last active June 30, 2017 07:47 — forked from andete/gist:71b531b081fbc3ac0671
KiCad csv BOM generter plugin
#!/usr/bin/env python
# (c) 2015 Productize <joost@productize.be>
# edited by Drunkar <drunkars.p@gmail.com>
import os
import sys
import copy
import collections
import codecs
@Drunkar
Drunkar / lato.less
Created May 30, 2017 09:37
slack for windowsで日本語フォントをnoto sans cjk jpに変更する。path: C:\Users\<ユーザ名>\AppData\Local\slack\app-<バージョン>\resources\app.asar.unpacked\src\static\lato.less
/*
This is a smaller variant of the new Lato2, serving compressed woff2 files.
Currently: TS-Only
Clients needs to have Lato2 pref turned ON.
The payload is 50% smaller. However, woff2 is not yet well supported,
so we're still providing the woff as fallback.
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#define NUMFLAKES 10
#define XPOS 0
/*
64 x 48 OLED version of:
https://www.mgo-tec.com/blog-entry-31.html
*/
#include <Wire.h>
#define OLED_ADDR (0x3C) //OLED address 製品に記載の数値は7bitなので、8bitに変換して1bit右へずらした値(78>>3c)
byte DotB1[8]={
B00000000,
// https://github.com/netlabtoolkit/VarSpeedServo
#include <VarSpeedServo.h>
VarSpeedServo myservo1;
VarSpeedServo myservo2;
VarSpeedServo myservo3;
void setup() {
myservo1.attach(9);
myservo2.attach(10);
.markdown-preview {
@c_border: #666; // border-color
max-width: 900px;
margin: 0 auto;
padding: 25px;
color: black;
hr {
margin: 50px 0;
background-color: transparent;
import argparse
parser = argparse.ArgumentParser(description="argparse template.")
parser.add_argument("-i", "--input", type=str, required=True, help="Required: Input file.")
parser.add_argument("-o", "--output", type=str, required=True, help="Required: Output file.")
parser.add_argument("-s", "--simulate", action="store_true", help="Simulate flag.")
args = parser.parse_args()
import time
import atexit
from datetime import datetime, timedelta
from neopixel import Adafruit_NeoPixel, Color
# LED strip configuration:
LED_COUNT = 16 # Number of LED pixels.
LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!).
LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)