Skip to content

Instantly share code, notes, and snippets.

View nuysoft's full-sized avatar
💭
I may be slow to respond.

高云 墨智 nuysoft

💭
I may be slow to respond.
View GitHub Profile
@nuysoft
nuysoft / expose.js
Last active December 31, 2015 10:39
模块化 Modular
"use strict";
/* global window */
/* global define */
/* global KISSY */
/*
https://gist.github.com/nuysoft/7974409
*/
@nuysoft
nuysoft / 修改前的语法树.json
Last active December 31, 2015 22:49
Hyde.js 的双向绑定绑定过程
{
"type": "program",
"statements": [
{
"type": "mustache",
"strip": {
"left": false,
"right": false
},
"escaped": true,
@nuysoft
nuysoft / gist:16c4d3f36a38e98b6e4e
Created January 15, 2015 16:49
解析倍增数
function parse(result) {
var cursor = 1,
arr = []
while (cursor <= result) {
if (result & cursor) arr.push(cursor)
cursor *= 2
}
console.log(arr)
}
@nuysoft
nuysoft / gist:e825b358103e6c984ebd
Created April 14, 2015 07:45
函数表达式的上下文变为 window
var hooks = {
foo: function() {
console.log(this)
},
_default: function() {
console.log(this)
}
}
owner.foo() // hooks
import store from './store'
export function render (container: any) {
if (!container) {
container = document.createElement('div')
container.id = ENGINE_CONTAINER
document.body.appendChild(container)
}
ReactDOM.render(