Skip to content

Instantly share code, notes, and snippets.

View kobachi's full-sized avatar

kobachi kobachi

View GitHub Profile
function urlencode {
t=$(echo "$1" | nkf -WwMQ | sed 's/=$//g' | tr = % | tr -d '\n')
echo ${t//\%2F/\/}
}
@kobachi
kobachi / number_to_human_readable.js
Created July 22, 2019 05:15
Human-Readable number format
/**
* 指定された値をSI接頭辞で表現した値に変換して返します
*
* @param value 変換したい値を指定します。
* @param round 丸めを指定します。0.1を指定すると小数第1位で四捨五入されます。デフォルト値=1
* @param binary 1000ではなく1024で接頭辞をつけます。デフォルト値=false
*
* toHumanReadable(1024) => 1K
* toHumanReadable(1024, 0.01) => 1.02K
* toHumanReadable(1024, 0.01, true) => 1Ki
@kobachi
kobachi / index.js
Created August 24, 2016 16:37
Electron Twitter Client Sample
"use strict";
const Electron = require("electron");
const open = require("open");
var window;
Electron.app.on("ready", () => {
window = new Electron.BrowserWindow({
width: 400,
height: 640,
@kobachi
kobachi / fontconfig.property
Last active July 21, 2016 16:32
Windows 7/8/10用Java用システムフォントフォールバック(プログラマー向けConsolas使用版)
#
#
# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
#
#
#
#
#
@kobachi
kobachi / Field.java
Last active September 4, 2015 01:31
Sandbox
public class Field<T> extends FinalField<T> implements Setter<T> {
public Field() {
this(null, true);
}
public Field(T value){
this(value, true);
}
@kobachi
kobachi / android-support-v4.jar.hash.md
Last active February 9, 2023 21:46
android-support-v4.jar Hash List
Revision SHA-1 MD5 URL
r04 c3029e4469274fa93dc9306a626275314e50a8e4 86dfb3c6ac2db479ff396906fe4ee1be https://dl-ssl.google.com/android/repository/support_r04.zip
r05 fb5b44c5924b42371105145c92a5825c1e7ac95d 6ed7cfa457967cb8d5924c93b96847e7 https://dl-ssl.google.com/android/repository/support_r05.zip
r06 7329492e76650ee661f6af7704b0c79151d8e1ef bcf017dfe2243c8d72b4b2aa40101040 https://dl-ssl.google.com/android/repository/support_r06.zip
r07 53307dc2bd2b69fd5533458ee11885f55807de4b c6c2148762c614d3bad120ca01491e34 https://dl-ssl.google.com/android/repository/support_r07.zip
r08 8790fea7a0bc1d42c69c648571e2c7a02c92cf4c 776555f10c632cd4f2790b6bbd2465bf https://dl-ssl.google.com/android/repository/support_r08.zip
r09 27c24d26e4c5d57976e6926367985548678e913c d0107ad5a43839ecdc08fbcf783bdb4f https://dl-ssl.google.com/android/repository/support_r09.zip
r10 612846c9857077a039b533718f72db3bc041d389 7c357558b1ef5cd16f1d312fe87c38a0 https://dl-ssl.google.com/android/repository/support_r10
@kobachi
kobachi / .bash_profile
Created April 15, 2015 00:49
Mac OS Xの*.appをターミナルからも呼べるようにする.bash_profile
for f in /Applications/*.app; do
n=`basename "$f"`;
a=${n%.*};
a=${a// /}
alias $a="open -a ${f// /\\ }"
done
@kobachi
kobachi / s3cp.cmd
Created March 6, 2015 12:03
s3cp / s3rm alias for AWS CLI
@echo off
setlocal
goto MAIN
:MAIN
if "%1"=="" goto ERROR_FILTER_NOT_SPECIFIED
if "%2"=="" goto ERROR_URL_NOT_SPECIFIED
set URL=%2
if not "%URL:~-1%"=="/" set URL=%URL%/
@kobachi
kobachi / boot2docker-cli.cmd
Last active August 29, 2015 14:15
Boot2Docker Minimum CLI
@echo off
setlocal
title boot2docker-cli
if not exist "%USERPROFILE%\.boot2docker" mkdir "%USERPROFILE%\.boot2docker"
call :SETUP_PATH
call :VERSION_CHECK
if not exist "%USERPROFILE%\.boot2docker\boot2docker.exe" call :DOWNLOAD_CLI
if not exist "%USERPROFILE%\.boot2docker\boot2docker.iso" call :DOWNLOAD_ISO
call :LAUNCH
goto EOF
@kobachi
kobachi / WidthNormalization.tsv
Created February 16, 2015 08:28
Unicode Normalization
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
FF01 ! 0021 !
FF02 " 0022 "
FF03 # 0023 #
FF04 $ 0024 $
FF05 % 0025 %
FF06 & 0026 &
FF07 ' 0027 '
FF08 ( 0028 (
FF09 ) 0029 )
FF0A * 002A *