Skip to content

Instantly share code, notes, and snippets.

[
{
"constant": true,
"inputs": [
{
"internalType": "contract ComptrollerLensInterface",
"name": "comptroller",
"type": "address"
},
{
@shao1555
shao1555 / 1.ime-switcher.json
Last active August 24, 2020 00:21
switch input methods using Karabina-Elements (put this file into ~/.config/karabiner/assets/complex_modifications)
{
"title": "Switch input method",
"rules": [
{
"description": "JISキーボードの「無変換」キーでUS入力に切替",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "japanese_pc_nfer"
@shao1555
shao1555 / jd-order-print-page-to-title.js
Created October 14, 2019 08:28
京东の注文明細印刷画面から抜き取った情報でファイル名をつくる
let tradeDate = document.querySelector(".t2").firstChild.nodeValue.match(/\d{4}-\d{2}-\d{2}/)[0];
let amount = document.querySelector(".ftx-01 .count").firstChild.nodeValue.match(/\d+\.\d{2}/)[0];
let productName = document.querySelector(".p-name").firstChild.nodeValue;
console.log(`${tradeDate} [JD.com] ${productName} CNY${amount}.pdf`);
@shao1555
shao1555 / taobao-order-page-cleanup.js
Created October 14, 2019 02:51
淘宝(Taobao)、天猫(Tmall)の注文画面をきれいにして印刷しやすくする
[".banner", "#p4p_ad", "#footer", ".J_guess-you-like", "#J_TbFooter", "#J_xiaomi_dialog", "#appBanner", "#appAldAdvert", "#appP4pAdvert", "#site-nav", "#J_MUIMallbar"].forEach(function(selector){
document.querySelectorAll(selector).forEach(function(node){
node.style.display = "none";
});
});
document.querySelectorAll("html,body").forEach(function(node){
node.style.backgroundColor = "#fff";
});
var proxy = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT",
mode = "white",
domains = {
"0-6.com": 1,
"0001688.com": 1,
"001cndc.com": 1,
"001en.com": 1,
"001jm.com": 1,
"001job.com": 1,
"001pp.com": 1,

小米 (シャオミ) スマートフォンのハックまとめ

  • 2017/04/06 v0.1 : 自分用のメモをもとに暫定公開

用語集

ROM

  • ここではAndroid OS と基本的なソフト(電話、カメラ、ブラウザなど)をひとまとめにしたシステム一式のことを指す。
  • 小米の ROM は以下の種類がある
@shao1555
shao1555 / gist:c4c4c9cd4707a37fd0b1
Last active December 15, 2015 08:33
Continuous shows WiFi connect information (OS X only)
while true
do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I |
ruby -e "
properties = {}
while line = STDIN.gets
match = line.match(/ *(.+): (.*)/)
key = match[1].strip
value = match[2].strip
properties[key.strip] = value.strip if match && key && value
end
@shao1555
shao1555 / how_to_setup.md
Last active September 23, 2015 13:08
Mac setup notes
@shao1555
shao1555 / tesla_unlock.rb
Created March 29, 2015 09:43
Hello, Tesla World.
require 'rest-client'
require 'json'
ENDPOINT = 'https://portal.vn.teslamotors.com/'
# login
session_id = ENV['TESLA_SESSION_ID']
user_credentials = ENV['TESLA_USER_CREDENTIALS']
unless session_id && user_credentials
login = RestClient.post(
@shao1555
shao1555 / gist:8643691
Created January 27, 2014 05:32
print disk usage per collections
db.getCollectionNames().forEach(
function(n) {
stats = db.getCollection(n).stats();
print([n, stats.size, stats.storageSize, stats.storageSize+stats.totalIndexSize, stats.totalIndexSize].join("\t"))
}
);