Skip to content

Instantly share code, notes, and snippets.

@RJHsiao
RJHsiao / file-dataUrl-converter.html
Last active September 23, 2023 23:45
File-DataURL Converter
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>File-DataURL Converter</title>
<style>
.converter-block > textarea {
width: 800px;
height: 300px;
}
@RJHsiao
RJHsiao / brew-cask-upgrade.sh
Last active February 14, 2024 09:55
Brew-Cask-Upgrade: Check and upgrade your app installed from caskroom automatically.
#! /usr/bin/env bash
# brew-cask-upgrade.sh: "Brew-Cask-Upgrade"
# Author: RJ Hsiao <rj-at-rjhsiao.me>
# Url: https://gist.github.com/RJHsiao/d4ee0ff671e76b02d9e5706294d3597c
# License: GPLv3
# Usage: sh brew-cask-upgrade.sh [options]
readonly NAME="Brew-Cask-Upgrade"
readonly VERSION="1.1.5"
readonly URL="https://gist.github.com/RJHsiao/d4ee0ff671e76b02d9e5706294d3597c"
### Keybase proof
I hereby claim:
* I am RJHsiao on github.
* I am rj_hsiao (https://keybase.io/rj_hsiao) on keybase.
* I have a public key whose fingerprint is 3262 A44C 7509 CBCC 23C2 3080 EC55 BD08 D155 D337
To claim this, I am signing this object:
@RJHsiao
RJHsiao / Insertion_Sort_With_Binary_Search.py
Created January 28, 2015 08:04
Insertion Sort With Binary Search
#! /usr/bin/env python3
import random
def BinarySearchInsertPoint(searchArray, searchKey):
if len(searchArray) == 0:
return 0
middleIndex = int(len(searchArray) / 2 - 0.5)
print(
"Target Array",
searchArray,
@RJHsiao
RJHsiao / /usr/lib/gtk-2.0/2.10.0/gtk.immodules
Created September 23, 2013 08:39
/usr/lib/gtk-2.0/2.10.0/gtk.immodules & /usr/lib/gtk-3.0/3.0.0/immodules.cache & /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/gtk.immodules & /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache
# GTK+ Input Method Modules file
# Automatically generated file, do not edit
# Created by /usr/lib/x86_64-linux-gnu/libgtk2.0-0/gtk-query-immodules-2.0 from gtk+-2.24.17
#
# ModulesPath = /home/rj/.gtk-2.0/2.10.0/x86_64-pc-linux-gnu/immodules:/home/rj/.gtk-2.0/2.10.0/immodules:/home/rj/.gtk-2.0/x86_64-pc-linux-gnu/immodules:/home/rj/.gtk-2.0/immodules:/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/x86_64-pc-linux-gnu/immodules:/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules:/usr/lib/x86_64-linux-gnu/gtk-2.0/x86_64-pc-linux-gnu/immodules:/usr/lib/x86_64-linux-gnu/gtk-2.0/immodules:/usr/lib/gtk-2.0/2.10.0/x86_64-pc-linux-gnu/immodules:/usr/lib/gtk-2.0/2.10.0/immodules:/usr/lib/gtk-2.0/x86_64-pc-linux-gnu/immodules:/usr/lib/gtk-2.0/immodules
#
"/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-cedilla.so"
"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa"
"/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-ibus.so"
WEBVTT FILE
1
00:00:00.500 --> 00:00:02.000 D:vertical A:start
The Web is always changing
2
00:00:02.500 --> 00:00:04.300
and the way we access it is changing
@RJHsiao
RJHsiao / Xorg.8.log
Created June 18, 2012 20:08
logs and conf about my bumblebee trouble
[ 92.741]
X.Org X Server 1.11.3
Release Date: 2011-12-16
[ 92.741] X Protocol Version 11, Revision 0
[ 92.741] Build Operating System: Linux 2.6.24-31-server x86_64 Ubuntu
[ 92.741] Current Operating System: Linux RJ-Lachesis 3.2.0-26-generic #41-Ubuntu SMP Thu Jun 14 17:49:24 UTC 2012 x86_64
[ 92.741] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-26-generic root=UUID=76c59cf4-314a-424c-9a9e-a0ab65837518 ro quiet splash vt.handoff=7
[ 92.741] Build Date: 07 May 2012 11:43:21PM
[ 92.741] xorg-server 2:1.11.4-0ubuntu10.2 (For technical support please see http://www.ubuntu.com/support)
[ 92.741] Current version of pixman: 0.24.4
@RJHsiao
RJHsiao / SetTrackPointSpeed.sh
Created June 19, 2011 18:59
Shell script for set TrackPoint's Speed & Sensitivity with login
#! /bin/bash
if [ ! -w /sys/devices/platform/i8042/serio1/serio2/sensitivity -o ! -w /sys/devices/platform/i8042/serio1/serio2/speed ];then
gksu --description "Get write permission to set TrackPoint's Speed & Sensitivity" chmod g+w /sys/devices/platform/i8042/serio1/serio2/sensitivity /sys/devices/platform/i8042/serio1/serio2/speed
fi
if [ `cat /sys/devices/platform/i8042/serio1/serio2/sensitivity` -ne 255 -o `cat /sys/devices/platform/i8042/serio1/serio2/speed` -ne 120 ]; then
echo -n 255 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
echo -n 120 > /sys/devices/platform/i8042/serio1/serio2/speed
fi