Skip to content

Instantly share code, notes, and snippets.

@liberize
liberize / wox_yd.ahk
Last active May 23, 2019 14:43
autohotkey 取词并调用 wox 有道翻译
; 取词快捷键 ctrl+shift+d
^+d::
clipboard =
Send, ^c
ClipWait, 1
StringLen, cliplen, clipboard
if (cliplen > 1000 or cliplen < 2) {
return
}
Run, %USERPROFILE%\AppData\Local\Wox\Wox.exe
# liberize @ home-pc in ~/Code/GitHub/mpv on git:master x [0:06:35]
$ python3 ./waf configure --prefix=/usr/local --enable-libmpv-shared -v
Setting top to : /Users/liberize/Code/GitHub/mpv
Setting out to : /Users/liberize/Code/GitHub/mpv/build
Checking for waf version in 1.8.4-2.0.0 : ok
Checking for program 'cc' : /usr/bin/cc
Checking for program 'pkg-config' : /usr/local/bin/pkg-config
Checking for program 'ar' : /usr/bin/ar
Checking for program 'rst2html' : not found
Checking for program 'rst2man' : not found
#!/bin/bash
apk="$1"
shopt -s expand_aliases
alias apktool="java -jar apktool_2.2.4.jar"
alias dex2jar="./dex2jar-2.0/d2j-dex2jar.sh"
alias jd-cli="java -jar jd-cli.jar"
echo "=> apk decompiling"
@liberize
liberize / snippets.cpp
Last active March 15, 2019 15:27
pico full angle detection
namespace {
const int MAX_DETS = 5;
const float SCALE_FACTOR = 1.1f;
const float STRIDE_FACTOR = 0.1f;
const float QUALITY_THRESH = 10.0f;
const float ANGLE_STEP = 45.0f;
}
@liberize
liberize / captcha.py
Last active April 7, 2019 15:09
简单验证码识别
#!/usr/bin/env python
# coding: utf-8
import os
import sys
from PIL import Image, ImageChops
templates = []
@liberize
liberize / duoshuo.py
Last active August 16, 2016 04:53
多说实时邮件提醒脚本
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import urllib
import smtplib
import time
import ConfigParser
import json
import os
@liberize
liberize / remove-google-redirect.uc.js
Last active July 15, 2021 15:47
UserScripts: 禁止google结果跳转
// ==UserScript==
// @name 禁止google结果跳转
// @namespace http://blog.whosemind.net
// @description 去掉google搜索结果的跳转(http://www.google.com/url?), 而直接用原始链接
// @version 0.0.7
// @include /^https?:\/\/www\.google\.[^\/]+?\/(#.*|webhp.*|search\?.*)?$/
// ==/UserScript==
var eles,
timer,
s,
@liberize
liberize / Default.sublime-keymap
Last active January 2, 2016 09:29
sublime text plugin to open file in different browser.
[
{ "keys": ["alt+o", "alt+f"], "command": "open_in_browser_alt", "args": {"browser": "firefox"} },
{ "keys": ["alt+o", "alt+s"], "command": "open_in_browser_alt", "args": {"browser": "safari"} }
]
@liberize
liberize / static-blog-search.html
Created November 21, 2013 02:25
Jekyll: Static Blog Search Based On Feed
<form id="search-form">
<input id="query" type="text" placeholder="正则搜索"></input>
<button type="submit"><i class="icon-search"></i></button>
</form>
<script type="text/javascript">
$(document).ready(function() {
var entries = null;
function htmlEscape(s) {
return String(s).replace(/[&<>"'\/]/g, function(s) {
@liberize
liberize / soduku-num-training.cpp
Created November 18, 2013 12:18
OpenCV: Sudoku Number Training
#include <fstream>
#include "opencv2/opencv.hpp"
#include <vector>
#include <io.h>
using namespace std;
using namespace cv;
// #define ON_STUDY