Skip to content

Instantly share code, notes, and snippets.

@joest67
joest67 / findp
Last active December 22, 2015 08:39
This shell script help to find matched content in files when you give a keyword.
#!/bin/bash
# Program:
# this program help us to find something in files'content.
# History:
# 05/11/2013 Joest First release
#
# usage:
# copye it to /usr/bin/ folder
@joest67
joest67 / query_bupt_library.user.js
Last active January 3, 2016 15:49
When you view book in the website of douban, it will automatic search the book from bupt library.
// ==UserScript==
//
// @name query_bupt_library
// @description Search books which you see in douban on BUPT's Library
// @namespace http://bbs.byr.cn/
// @author joest(chaojiong.zheng@gmail.com)
// @license GNU GPL v3 (http://www.gnu.org/copyleft/gpl.html)
// @version 1.0
// @include http://book.douban.com/subject/*
//
@joest67
joest67 / xiami_music_download.user.js
Created January 18, 2014 02:06
Download free music from xiami.
// ==UserScript==
//
// @name xiami_music_download
// @description download free music from xiami
// @namespace http://www.xiami.com/
// @author joest(chaojiong.zheng@gmail.com)
// @license GNU GPL v3 (http://www.gnu.org/copyleft/gpl.html)
// @version 1.0
// @include http://www.xiami.com/search*
//
@joest67
joest67 / douban_bt.user.js
Created January 18, 2014 02:27
When you find a wonderful movie in douban, this script will automatic search its torrent from bt.byr.cn.
// ==UserScript==
//
// @name byr_bt
// @description Search movies on bt which you see in douban
// @namespace http://bt.byr.cn/
// @author joest(chaojiong.zheng@gmail.com)
// @license GNU GPL v3 (http://www.gnu.org/copyleft/gpl.html)
// @version 1.0
// @include http://movie.douban.com/subject/*
//
@joest67
joest67 / gotop_of_page
Last active August 29, 2015 13:57
This script is used for going to top of the page you are viewing.
$(document).ready(function(){
var $backToTopTxt = "返回顶部"
var $backToTopEle = $('<div class="backToTop"></div>').appendTo($(".site"))
.text($backToTopTxt).attr("title", $backToTopTxt).click(
function() {
$("html, body").animate({ scrollTop: 0 }, 120);
}),
$backToTopFun = function() {
var st = $(document).scrollTop(), winh = $(window).height();
(st > 500)? $backToTopEle.show(): $backToTopEle.hide();
void exch(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
void exch(int *a, int *b)
{
int temp = *a;
@joest67
joest67 / newFile
Created May 9, 2014 14:19
app for creating file on Finder.
--Based on script found at: http://superuser.com/questions/14118/easiest-way-to-create-a-new-text-file-in-a-finder-window-on-osx
tell application "Finder"
--The following line is commented out since it is buggy in Lion.
--set p to insertion location
try
set p to folder of window 1
on error
set p to desktop
end try
set f to make new file at p
# -*- coding: utf-8 -*-
__author__ = 'mactalk'
import urllib, urllib2, HTMLParser
#文章列表
article_list = []
#Instapaper 的用户名和密码
username = "username@gmail.com"
@joest67
joest67 / last_zero.py
Created September 17, 2014 03:18
get zero count of factorials n.
def last_zero_num(n):
count = 0
while n:
count += n / 5
n = n / 5
return count
@joest67
joest67 / pr_hipchat_notify.sh
Created December 11, 2014 03:06
Nofify us when we receive a pull-request by hipchat
#!/bin/sh
# Source config file
# should contains follows variables:
# AUTH_TOKEN
# ROOM_ID
source config.sh
my_func() {
return 1