Skip to content

Instantly share code, notes, and snippets.


Yoga Lin blueandhack

Block or report user

Report or block blueandhack

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jayliew /
Created Mar 22, 2018
USB barcode scanner read in Python on Raspberry Pi Raspbian
# Props to user brechmos for sharing the code here:
# Tested with the following barcode scanner
# macbook# ioreg -p IOUSB
# <snip>
# | +-o WIT 122-UFS V2.03@14200000 <class AppleUSBDevice, id 0x10000c3c4, registered, matched, active, busy 0 (6 ms), retain 14>
# WIT 122-UFS V2.03:
# Product ID: 0x1010
# Vendor ID: 0x05fe (CHIC TECHNOLOGY CORP)
lakshmantgld /
Last active Aug 31, 2019
Free Sales Tax API based on Postal code by Avalara

Sales Tax API

There are many companies providing sales tax API. Out of all the companies, Avalara offers free API service for sales Tax. This gist is all about setting up avalara API and querying it.

The Free-To-Use API by avalara has some restrictions. Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP response code 429 - Too Many Requests. The requirement for this API is to create an avalara free trail account. You can create a free account using this link create free account.

Once you have filled the form from above link, you will get an e-mail containing temporary credentials to login the avalara account. The e-mail will look something like this:

Avalara e-mail

0x263b /
Last active Aug 15, 2019
Random color from string in javascript

Random color from string in javascript

Consider a list of strings you need to permanently assign a random color.

First you should turn the string into a hash.

var string = "string"
var hash = 0
View surge.conf
skip-proxy =,,,,, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun =,,
# dns-server =,,
loglevel = notify
BJ-All = custom
BJ-HK-Azure = custom
BJ-US-Azure = custom
selsta / autosub.lua
Last active May 11, 2019
Automatically download subtitles in mpv using subliminal.
View autosub.lua
-- requires subliminal, version 1.0 or newer
-- default keybinding: b
-- add the following to your input.conf to change the default keybinding:
-- keyname script_binding auto_load_subs
local utils = require 'mp.utils'
function load_sub_fn()
subl = "/usr/local/bin/subliminal" -- use 'which subliminal' to find the path"Searching subtitle")
mp.osd_message("Searching subtitle")
t = {}
P233 / ios7-theme-for-v2ex
Last active Dec 9, 2016
View ios7-theme-for-v2ex
a:link, a:visited, a:active {
color: #8e8d93;
-webkit-transition: all .15s;
-moz-transition: all .15s;
-ms-transition: all .15s;
-o-transition: all .15s;
transition: all .15s;
},, {
color: #000;
You can’t perform that action at this time.