This file contains 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
import sys | |
import types | |
import os | |
import urllib | |
import cgi | |
import logging | |
from Cookie import SimpleCookie | |
# instance | |
_liter = None |
This file contains 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
from pili import lite | |
def main(): | |
lite.init(globals()) | |
echo('hello world') | |
if __name__ == '__main__': | |
main() |
This file contains 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:(function () { var scroll_length = 20; var stuck_threshold = 2; var height = 4000; var url = window.location.href.split("url=")[1]; var wait = parseInt(url.split("#")[1]); var start_time = new Date().getTime() / 1000; var yo = function () { document.getElementById('ttt').contentWindow.document.getElementById('footer-links').innerHTML += "<div style='background-color:gray;width:10px;position:absolute;height:" + height + "px;top:0;left:0;'> <\/div>"; var win = document.getElementById('ttt').contentWindow; var doc = document.getElementById('ttt').contentWindow.document; var i = 0; var last = 0; while (i < height) { win.scrollTo(0, i); i += scroll_length; } alert("#take:" + ((new Date().getTime() / 1000) - start_time - wait / 1000)); }; setTimeout(yo, wait); document.body.innerHTML = ("<iframe id='ttt' src='" + url + "' width='100%' height='100%'></iframe>"); })(); |
This file contains 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
function wtitle(){ echo -ne "\033]0; $@ \007"; } |
This file contains 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
from google.appengine.api import urlfetch | |
result = urlfetch.fetch("http://software.sopili.net/") | |
result.content |
This file contains 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
function htmlhex_decode($str){ | |
if(preg_match_all("/&#(\d+);/",$str,$match)){ | |
foreach($match[1] as $key=>$value){ | |
$str=str_replace($match[0][$key],"\u".dechex($value),$str); | |
} | |
} | |
$str=preg_replace("/&#x(\d+);/","\\u$1",$str); | |
$str=str_replace(Array("\r","\n"),Array("\\r","\\n"),$str); |
This file contains 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
function big52utf8($big5str) { | |
$blen = strlen($big5str); | |
$utf8str = ""; | |
for($i=0; $i<$blen; $i++) { | |
$sbit = ord(substr($big5str, $i, 1)); | |
//echo $sbit; | |
//echo "<br>"; | |
if ($sbit < 129) { |
This file contains 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 '/home/www/config.php'; | |
//或是這樣 | |
require '../config.php'; //但這樣子在crontab不能跑 | |
//當然,接下來的路徑就使用變數或常數來寫程式 | |
require SOPILI_PATH.'/lib/db_connection.php'; |
This file contains 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
<?php | |
require '../../config.php'; //原本是這樣 | |
require dirname(__FILE__)."/../../config.php"; //改成這樣 |
This file contains 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
<?php | |
//宣告 | |
var url_arr=new Array('software.sopili.net','dev.sopili.net'); | |
//讀取 | |
for(var i in url_arr){ | |
document.write(url_arr[i]+'<br>'); | |
} |
OlderNewer