This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo generating... | |
curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /tmp/chnroute.txt && echo "chnroute.txt generated" || exit 0 | |
echo copying... | |
cp /tmp/chnroute.txt /etc/storage/DEADC0DE/chnroute/ | |
echo cleaning... | |
rm -rf /tmp/chnroute.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'package) | |
(add-to-list 'package-archives '("melpa" . "https://elpa.emacs-china.org/melpa/") t) | |
(add-to-list 'package-archives '("gnu" . "https://elpa.emacs-china.org/gnu/") t) | |
(add-to-list 'package-archives '("org" . "https://elpa.emacs-china.org/org/") t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//除法函数,用来得到精确的除法结果 | |
//说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。 | |
//调用:accDiv(arg1,arg2) | |
//返回值:arg1除以arg2的精确结果 | |
function accDiv(arg1, arg2) { | |
var t1 = 0, | |
t2 = 0, | |
r1, r2; | |
try { | |
t1 = arg1.toString().split(".")[1].length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>test</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
/* | |
* @description 原始词库 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Place homebrewupdate.sh where ever you like, I use ~/bin/homebrewupdate.sh | |
2. Place the .plist file in ~/Library/LaunchAgents and update the path to your bash script | |
3. run 'launchctl load ~/Library/LaunchAgents/com.jb510.homebrewupdate.plist' or whatever you've named your plist file. | |
4. check 'launchctl list | grep jb510' to see that it's running | |
Note: you might need to `chmod +x homebrewupdate.sh` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
# -*- coding: utf-8 -*- | |
from time import sleep | |
from argparse import ArgumentParser | |
import requests | |
from bs4 import BeautifulSoup | |
from bs4.element import Tag | |
class Search(object): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
#-*- encoding:utf-8 -*- | |
from operator import itemgetter | |
from queue import Queue | |
from threading import Thread | |
from subprocess import STDOUT, check_output, CalledProcessError | |
from collections import OrderedDict | |
import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Linux usage: ./extract_tampermonkey_script.py "/home/<USER>/.config/<BROWSER>/Default/Local Extension Settings/<EXTENSION_ID>" | |
# i.e.: ./extract_tampermonkey_script.py "/home/foo/.config/google-chrome-beta/Default/Local Extension Settings/gcalenpjmijncebpfijmoaglllgpjagf" | |
# Mac usage: ./extract_tampermonkey_script.py "/Users/<USER>/Library/Application Support/Google/Chrome/Default/Local Extension Settings/<EXTENSION_ID>/" | |
# i.e.: ./extract_tampermonkey_script.py "/Users/foo/Library/Application Support/Google/Chrome/Default/Local Extension Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo/" | |
import leveldb | |
import sys | |
import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Youdao Dictionary Enhancer | |
// @namespace http://tampermonkey.net/ | |
// @version 1.1 | |
// @description search words Celerity | |
// @author creamidea | |
// @match http://dict.youdao.com/* | |
// @require http://cdn.bootcss.com/nprogress/0.2.0/nprogress.min.js | |
// @resource nprogress_css http://cdn.bootcss.com/nprogress/0.2.0/nprogress.min.css | |
// @resource etymoline_css http://www.etymonline.com/style.css |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
"%~dp0emacsclientw.exe" -na "%~dp0runemacs.exe" "%1" |
NewerOlder