Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@billy3321
billy3321 / get_metadata.py
Created February 15, 2014 13:19
Get ivod urls
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import urllib, urllib2
import json
import cookielib
from BeautifulSoup import BeautifulSoup, SoupStrainer
base_url = 'http://ivod.ly.gov.tw/'
committee_url = 'http://ivod.ly.gov.tw/Committee/CommsDate'
This file has been truncated, but you can view the full file.
< !DOCTYPE html >
<html lang = "zh" id = "facebook" class = "no_js" >
<head >< meta charset = "utf-8" / ><script > function envFlush (a)
{
function b (c)
{
for (var d in a)
c[d] = a[d];
}
if (window.requireLazy)
#!/bin/bash
export PIDFILE="/var/run/obfsproxy.pid"
export PASS="P@ssw0rd"
export DEST="127.0.0.1:22"
export SERVER="xx.xx.xx.xx:2222"
export DAEMON="obfsproxy --log-min-severity=info obfs2 --shared-secret=${PASS} --dest=${DEST} server ${SERVER}"
### BEGIN INIT INFO
@billy3321
billy3321 / battle-state
Created July 3, 2012 06:55
erep battle stats collection
//Author: Billy Zhe-Wei Lin
//Use for get erep battle stats
//Licence: BSD
var battleId = '30140';
$j.getJSON("/en/military/battle-stats/"+ battleId +"/2", function(data){
console.log(data);
var allStats = data.stats.current;
var div1 = {};
var div2 = {};
//---------------------------------------------------------------------------
// v1.0.13
// 参考Bronie FPeD http://userscripts.org/scripts/review/70450
//---------------------------------------------------------------------------
var $j = jQuery.noConflict();
var currURL = location.href;
var rank = {
Recruit: 1,
Private: 2,
'Private *': 3,
@billy3321
billy3321 / health.js
Created May 19, 2012 17:50
eat food after restore health
javascript:healthCounterResetCallback=function(hours,mins,secs){if(hours == 0 && mins == 0 && secs == 0){i=$j('#DailyConsumtionTrigger');$j(".resetFoodContainer").hide();$j("#foodText").show();i.removeClass('reset');if(typeof(battleFX) != 'undefined'){var h=$j('#heal_btn');h.removeClass('health_kit_btn');h.addClass('food_btn');}var val=parseFloat($j('#current_health').html());if(val<100){i.removeClass('disabled');}if(reset_has_food == 0){i.removeClass('disabled');i.addClass('buy');$j("#foodText").html(textForBuy);}var t=food_remaining + 100;if(t >= reset_health_to_recover){food_remaining=reset_health_to_recover;$j("#foodResetHoursContainer").css('display','none');} else{food_remaining=t;var a=new ERPK.countDown({display: $j("#foodResetHours"),startTime: "01:00:00",stopTime: "00:00:00",onExpire: healthCounterResetCallback});$j("#foodResetHoursContainer").css('display','block');}$j('.tooltip_health_limit').html(food_remaining + " / " + reset_health_to_recover);if(val<100){eatFood();}}}
@billy3321
billy3321 / connect_wify.sh
Created April 10, 2012 10:16
This script is used to connect to wify
#!/bin/bash
# This script is writen by billy3321
# this script is used to connect to wireless network.
#set -o xtrace
IF=$(echo $1 | tr 'A-Z' 'a-z')
AUTH=$(echo $2 | tr 'A-Z' 'a-z')
ESSID=$3
KEY=$4
lazyscripts@lazyscripts-vm:~/src/git/lazyscript/devtools/build$ ./build.sh
++ pwd
+ CURRENT_PWD=/home/lazyscripts/src/git/lazyscript/devtools/build
+ cd /home/lazyscripts/src/git/lazyscript/devtools/build
+ read -p 'Please type version: ' VERSION
Please type version: 0.1rc1
+ filename=lazyscripts-0.1rc1.tar.gz
+ cd ../..
+ git archive --format=tar master
+ gzip -9
" buffer sel by pattern {{{
" ====================================
function! BufSel(pattern)
let buf_count = bufnr("$")
let cur_bufnr = 1
let nummatches = 0
let firstmatchingbufnr = 0
while cur_bufnr <= buf_count
if(bufexists(cur_bufnr))
let currbufname = bufname(cur_bufnr)