Skip to content

Instantly share code, notes, and snippets.

@wintercn
wintercn / JD.md
Last active December 29, 2015 14:58

移动富交互应用Job Design

Moria[Mobile Rich Interactive App]

工作职责

  • 负责Mobile端创意营销和游戏化场景的业务开发
@wintercn
wintercn / ktxp-thunder.js
Created November 17, 2013 16:33
糟糕的兴趣呢 嗯……
var names = [
/【猪猪字幕组】★4月新番 美食的俘虏Toriko 第\d*话/g,
/【Dymy字幕組】【魔笛_Magi 第二季】【\d*】/g,
/【Dymy字幕組】【東京暗鴉 Tokyo Ravens】【\d*】/g,
/\[OPFans枫雪动漫\]\[ONE PIECE 海贼王\]\[第\d*话\]/g,
/【极影字幕社】 ★物语系列/g
];
var request = new ActiveXObject("MSXML2.XmlHttp.6.0");
request.open("GET","http://bt.ktxp.com/index-1.html",false)
request.send(null);
@wintercn
wintercn / adhocSort.js
Created September 30, 2013 03:19
假期前小玩意,ad-hoc排序
function shuffle(array){
for(var i = array.length-1; i > 0; i--) {
var rnd = Math.floor(Math.random() * (i+1));
var tmp = array[i];
array[i] = array[rnd];
array[rnd] = tmp;
}
}
function isInOrder(array) {
for(var i = 0; i < array.length-1; i++)
@wintercn
wintercn / template.html
Created September 29, 2013 14:52
一个简单的dom型模板示例
<div>
<a href="{{protocol}}//{{host}}{{pathname}}">{{protocol}}//{{host}}{{pathname}}</a>
</div>
<script>
function Template(node) {
var prototype = document.createDocumentFragment();
prototype.appendChild(node);
@wintercn
wintercn / pylexer.html
Created September 24, 2013 15:02
python词法分析
<body>
<style>
.number {
color:purple;
}
.keyword {
color:blue;
}
.string {
@wintercn
wintercn / gist:6666747
Created September 23, 2013 05:28
Web API里可以new的东西
//Chrome上能用的
["Image", "Audio", "MediaController", "TrackEvent", "Option", "PopStateEvent", "HashChangeEvent", "PageTransitionEvent", "Event", "CustomEvent", "MutationObserver", "Document", "FormData", "XMLHttpRequest", "FormData", "IDBVersionChangeEvent", "StorageEvent", "RTCSessionDescription", "RTCIceCandidate", "MediaStreamEvent", "Notification", "Blob", "FileReader", "ErrorEvent", "Worker", "SharedWorker", "TransitionEvent"]
//标准里有但是还不能用的
["RelatedEvent", "DragEvent", "AnonXMLHttpRequest", "RTCPeerConnection", "RTCPeerConnectionIceEvent", "DataChannelEvent", "ClipboardEvent", "FileReaderSync", "BlobBuilder", "FileSaver", "ParGroup", "SeqGroup", "Animation", "PseudoElementReference", "KeyframeAnimationEffect", "PathAnimationEffect", "TimingEvent", "AnimationEvent"]
function run(code,callback){
callback = callback || function(r){
//console.log(r);
};
function check(f){
if(f instanceof Function) {
@wintercn
wintercn / local.md
Created July 21, 2013 14:45
浅谈代码的局部性

我是JS中"就近声明"以及"允许多次var声明"的拥护者。

我持这样观点源自我对易读性的追求。

看一段代码:

function aFunc() {
    for(var i = 0; i < 100; i++) {
 doSth(i);
[
{
name:"HTML5",
uri:"http://www.w3.org/TR/html5/single-page.html",
category:"markup"
},
{
name:"HTML 5.1",
uri:"http://www.w3.org/TR/html51/single-page.html",
category:"markup"
@wintercn
wintercn / gist:5918272
Created July 3, 2013 14:18
CSS3 标准和属性对应数据
[
{
"spec name": "CSS Animations",
"uri": "http://www.w3.org/TR/css3-animations",
"category": "css-property",
"Name": "animation-name",
"Value": "<single-animation-name> [\n ‘,’ <single-animation-name> ]*",
"Initial": "‘none’",
"Applies To": "all elements, ::before and ::after pseudo-elements",
"Inherited": "no",