Skip to content

Instantly share code, notes, and snippets.

View yuanchuan's full-sized avatar

Yuan Chuan yuanchuan

View GitHub Profile
#/bin/sh
visit() {
awk '!/POST|scripts|images|styles|admin|logshare/ { print $1; }' $1
}
shake() {
awk '/POST/ && /shake/ { print $1; }' $1
}
count() {
wc -l | awk '{print $1}'
@yuanchuan
yuanchuan / gist:85554d7f36795558da60
Last active August 29, 2015 14:00
Interstellar Movie - Official Teaser
We’ve always defined ourselves by the ability to overcome the impossible.
And we count these moments.
These moments when we dare to aim higher, to break barriers, to reach for the stars, to make the unknown known.
We count these moments as our proudest achievements.
Are we lost on that?
Perhaps, we’ve just forgotten that we are still pioneers.
And we’ve barely begun.
And that our greatest accomplishments cannot be behind us, because our destiny lies above us.

Keybase proof

I hereby claim:

  • I am yuanchuan on github.
  • I am yuanchuan (https://keybase.io/yuanchuan) on keybase.
  • I have a public key whose fingerprint is 4D7B C6B5 CE47 FC6D 06A7 9350 8355 451C E446 6990

To claim this, I am signing this object:

var notify = (function() {
var origin = document.title.replace(/^\(\d\)?/, '');
var pattern = '(*) ';
return {
clear: function() {
document.title = origin;
},
count: function(n) {
document.title = pattern.replace('*', n) + origin;
}
var imageList=(function(){
var _list=[],_head;
$('#imageList li').each(function(){
_list.push($(this));
});
_head=_list[0];
return {
(function(str){
var maxPalin='';
for(var i=0,len=str.length;i<len;++i){
var letter=str[i],substr;
for(var j=i;j<len;++j){
if(letter == str[j]){
maxPalin=(function(substr){
return (function(substr){
@yuanchuan
yuanchuan / Generate html tags in php.php
Created October 23, 2010 09:10
Generate html tags
<?php
/*
* 快速生成 html 标签
* version: 0.01
* Created: 2010/10/23
*
* TODO: 1.精简函数代码,一般单个函数的长度不超过一屏
* 2.增加容错处理
* 3.<link /> <img /> <br /> 没有考虑进去, 待补充,
/**
* Get random charactor from a given charset
*/
var getRandomChar = (function(str) {
var len = str.length;
return function() {
return str.charAt(Math.floor(Math.random() * len));
};
function new_array(/* length */ len, /* default */ value) {
var len = ~~len;
return value
? new Array ( len + 1 ).join( value ).split( '' )
: new Array ( len );
}
@yuanchuan
yuanchuan / gist:833201
Created February 18, 2011 03:25
An interesting question
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title> An interesting question</title>
<style>
table {
border-collapse:collapse;
border-spacing:0;
margin: 100px auto 0;