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
<html> | |
<head> | |
</head> | |
<body> | |
<img src="http://pics.blog.yam.com/badimage.jpg" /> | |
<script> | |
function hi(){ | |
var i=new Image(); | |
i.onerror=function(){alert('error and do something');}; | |
i.src="http://pics.blog.yam.com/badimage.jpg"; |
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
{ | |
list: "<ul><li><pre><span class="cursor focus">●</span> 15{1}{4}{14}?{5}{2} 3/21 {10}中央社{8} {11}{9}{14}"{12}{6}{13}{3}{4}{14}?{5}"{6}>連勝文遭槍擊案 地院5月宣判{8}{8} {7} | |
{0} 16{1}{4}{15}?{5}{2} 3/21 {10}中廣新聞網 {11}{9}{15}"{12}{6}{13}{3}{4}{15}?{5}"{6}>廣告不實標示錯誤 中興保全遭罰90萬{8} {7} | |
{0} 17{1}{4}{16}?{5}{2} 3/21 {10}中央社{8} {11}{9}{16}"{12}{6}{13}{3}{4}{16}?{5}"{6}>馬總統:TIFA卡在美牛問題{8}{8}{8}{7} | |
{0} 18{1}{4}{17}?{5}{2} 3/21 {10}中央社{8} {11}{9}{17}"{12}{6}{13}{3}{4}{17}?{5}"{6}>博鰲:台灣競爭力亞洲第2{8}{8}{8} {7} | |
{0} 19{1}{4}{18}?{5}{2} 3/21 {10}中廣新聞網 {11}{9}{18}"{12}{6}{13}{3}{4}{18}?{5}"{6}>油電人事成本太高? 施顏祥:燃料才最高{8} {7} | |
{0} 20{1}{4}{19}?{5}{2} 3/21 {10}NOWnews{8} {11}{9}{19}"{12}{6}{13}{3}{4}{19}?{5}"{6}>女神卡卡一票難求 驚爆內線偷跑?{8}{8}{7} | |
{0} 21{1}{4}{20}?{5}{2} 3/21 {10}中央社{8} {11}{9}{20}"{12}{6}{13}{3}{4}{20}?{5}"{6}>昶昕:未賣硫酸銅給飼料商{8}{8}{8}{7} | |
{0} 22{1}{4}{21}?{5}{2} 3/21 {10}中央社{8} {11}{9}{21}"{12}{6}{13}{3}{4}{21}?{5}"{6}>免試入學 方文山:別擔心太多{8}{8} {7} | |
{0} 23{1}{4}{22}?{5}{2} 3/21 {10}路透社{8} {11}{9}{22}"{ |
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 | |
$url_arr=Array('software'=>'software.sopili.net','dev'=>'dev.sopili.net'); | |
foreach($url_arr as $key=>$value){ | |
echo $key."<br>"; //重點是 key,有時候非常的需要key這個值,然後是字串型態 | |
} |
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={'software':'software.sopili.net','dev':'dev.sopili.net'}; | |
//讀取 | |
for(var key in url_arr){ | |
//這裡面的key值,就真的是字串了! | |
document.write(url_arr[key]+'<br>'); | |
} |
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
<input type='button' onclick="window.location.href='http://tools.sopili.net/';" value='執行' /> |