Skip to content

Instantly share code, notes, and snippets.

@tabahara
tabahara / set_natural_scrolling.sh
Last active June 30, 2017 02:35
setup natural scrolling on X.org
#!/bin/bash
xinput set-prop 9 291 1
# based on https://askubuntu.com/a/907505
# How to get these magics!
#
# 1. find your mouse id
# xinput list
# 2. find your mouse attributes for Natural Scrolling Enabled.
# xinput list-porps 'id'
@tabahara
tabahara / External Tools.xml
Created April 12, 2017 02:25
Android Studio My External Tools.
<toolSet name="External Tools">
<tool name="plantuml-view" description="plantuml-view" showInMainMenu="true" showInEditor="true" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="false" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="false">
<exec>
<option name="COMMAND" value="$USER_HOME$/bin/plantuml-view.cmd" />
<option name="PARAMETERS" value="$FileName$" />
<option name="WORKING_DIRECTORY" value="$FileDir$" />
</exec>
</tool>
<tool name="emacs client" description="emacs client" showInMainMenu="true" showInEditor="true" showInProject="false" showInSearchPopup="false" disabled="false" useConsole="false" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="false">
<exec>
package com.example.androidthings.myproject;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import com.google.android.things.pio.I2cDevice;
import com.google.android.things.pio.PeripheralManagerService;
@tabahara
tabahara / convertColorName.py
Last active February 22, 2017 06:22
convert color code to material color name.
#!/usr/bin/env python
import sys
import re
def convertColor(c):
color = c.lower()
if color=="#ffebee":
return "red_50"
elif color=="#ffcdd2":
return "red_100"
@tabahara
tabahara / make.filter.py
Created November 20, 2016 03:33
iptables setup sample
#!/usr/bin/python3
import urllib.request
import re
import os
urls=[
"https://ipv4.fetus.jp/cn.txt",
"https://ipv4.fetus.jp/kr.txt",
"https://ipv4.fetus.jp/hk.txt",
@tabahara
tabahara / gulpfile.js
Last active April 15, 2016 16:51
pandoc-filter-plantuml sample
// plantuml-filter.js -- tabahara/pandoc-filter-plantuml
var gulp = require('gulp');
var pandoc = require('gulp-pandoc');
var browserSync = require('browser-sync');
gulp.task('pandoc', function(){
gulp.src('*.md')
.pipe(pandoc({
from:'markdown',