Skip to content

Instantly share code, notes, and snippets.

View girvan's full-sized avatar
Hello World!

Hi girvan

Hello World!
View GitHub Profile
@girvan
girvan / gist:5453256
Created April 24, 2013 15:57
jump out of google/yahoo/bing s' cached page
<script>
(function(d, l){
if(l.href.match(/(cc.bingj.com|webcache.google)/))
l.href = d.getElementsByTagName('a')[0].href;
})(document, location);
</script>
<u><a href="http://kenalice.pixnet.net/blog">http://kenalice.pixnet.net/blog</a></u>
<div class="pili">
<p>嗨~我是 kenalice,我搬家囉!</p>
<span>本篇文章已經搬移到 <a href="http://bin.pilipress.com/2013/04/httpkenalicepixnetnet.html">這裡</a>,謝謝!</span>
<b>搬家工具由 <a href="http://pilipress.com" target="_blank">PiliPress</a> 提供</b>
</div>
@girvan
girvan / gist:5298009
Last active December 15, 2015 17:39
dora migration
<u><a href="http://dora98783.pixnet.net/blog">http://dora98783.pixnet.net/blog</a></u>
<div class="pili">
<p>嗨~我是 朵拉,我搬家囉!</p>
<span>本篇文章已經搬移到 <a href="http://bin.pilipress.com/2013/04/httpdora98783pixnetnetblog.html">這裡</a>,謝謝!</span>
<b>搬家工具由 <a href="http://pilipress.com" target="_blank">PiliPress</a> 提供</b>
</div>
javascript:
(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}func
@girvan
girvan / s3.php
Last active December 14, 2015 17:39
s3 service
<?php
define('S3_PATH', '/var/www/data/s3');
define('S3_DN', 's3.exammple.com');
function _s3_check($s3_filename)
{
$cmd = sprintf("ssh %s 'ls -al %s 2>/dev/null && echo 1;';"
,S3_DN, S3_PATH . '/' . $s3_filename);
$resp = shell_exec($cmd);
@girvan
girvan / gist:5030225
Created February 25, 2013 14:41
change jquery from ajax.googleapis.com to cdnjs.cloudflare.com
find ./* -type f -exec sed -i \
"s/ajax.googleapis.com\/ajax\/libs\/jquery\//cdnjs.cloudflare.com\/ajax\/libs\/jquery\//g" {} \;
@girvan
girvan / javascript-queue.js
Last active December 12, 2015 06:28
javascript queue
/*
Example:
queue(function(){ click_it(); }, 1000);
queue(function(){ refresh_it(); }, 1800);
// it will run click_it() at 1sec, and run refresh_it() at 2.8sec
*/
var _queue_runner;
var from_base='http://www.wretch.cc/blog/tpaobj', to_base = 'http://tpaobj.pixnet.net/blog'
, mapping = [['/1860654','/post/31234807'],
['/1861329','/post/31234809'],
['/1861358','/post/31234811'],
['/1893014','/post/31234823'],
['/1909423','/post/31234829'],
['/1912188','/post/31234835'],
['/1926607','/post/31234839'],
['/1929166','/post/31234841'],
['/1936046','/post/31234843'],
@girvan
girvan / gist:4619304
Created January 24, 2013 09:46
wretch migration css
p, b, span {font-weight:normal;margin:0;padding:0;}
h1, #main2, h1 .description, u {display:none;}
.description, .description b, .description span, .description p {display:block;}
.description {margin:12% 20% 0 20%;background-color:lightblue;padding:30px;border:dashed 2px gray;}
.pili {font-size:32px;font-family:Simhei, arial;}
.pili p {}
.pili span {margin:24px 0 45px 0;text-align:center;}
.pili b {text-align:center;font-size:18px;}
.pili b a {font-family:cursive;}
          time                     |  file1  |  file2  | file 3  | file 4  |  file5

-----------------------------------------|----------|-------|-------|------|------| 2012-12-28 00:00:01 +0800 | 147 | 158 | 149 | 158 | 1350 2012-12-28 00:01:01 +0800 | 321 | 794 | 151 | 178 | 154 2012-12-28 00:02:02 +0800 | 157 | 178 | 153 | 181 | 151 2012-12-28 00:03:01 +0800 | 178 | 163 | 151 | 165 | 163 2012-12-28 00:04:02 +0800 | 158 | 173 | 176 | 168 | 165 2012-12-28 00:05:02 +0800 | 152 | 155 | 151 | 167 | 170 2012-12-28 00:06:01 +0800 | 151 | 171 | 153 | 156 | 157 2012-12-28 00:07:01 +0800 | 157 | 157 | 165 | 147 | 169