Skip to content

Instantly share code, notes, and snippets.

View guo-yu's full-sized avatar
🌉
In Tokyo

Guo Yu guo-yu

🌉
In Tokyo
View GitHub Profile
### Keybase proof
I hereby claim:
* I am guo-yu on github.
* I am turing (https://keybase.io/turing) on keybase.
* I have a public key whose fingerprint is 8E29 8B80 4274 5B10 232F 174F 5B12 3599 1CF7 7ABC
To claim this, I am signing this object:
@guo-yu
guo-yu / airpub-cdn-index.html
Last active August 29, 2015 14:05
running a Airpub blog by only 40 lines of html code.
<!DOCTYPE html>
<html ng-app="airpub" ng-controller="global">
<head ng-controller="meta">
<base href="/" />
<meta charset="UTF-8">
<title ng-bind="title"></title>
<meta name="fragment" content="!" />
<meta name="description" content="{{description}}">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<!-- dependencies stylesheets and scripts -->
function nyan(option) {
var bpm = option.bpm || 120;
// Intro
var intro = beeplay({bpm: bpm})
.play(null, 2)
.play('D#5', 1/4).play('E5', 1/4).play('F#5', 1/2)
.play('B5', 1/2).play('D#5', 1/4).play('E5', 1/4)
.play('F#5', 1/4).play('B5', 1/4).play('C#6', 1/4).play('D#6', 1/4)
.play('C#6', 1/4).play('A#5', 1/4).play('B5', 1/2)
.play('F#5', 1/2).play('D#5', 1/4).play('E5', 1/4)

Keybase proof

I hereby claim:

  • I am turingou on github.
  • I am turing (https://keybase.io/turing) on keybase.
  • I have a public key whose fingerprint is 8E29 8B80 4274 5B10 232F 174F 5B12 3599 1CF7 7ABC

To claim this, I am signing this object:

var a = function(fn1, fn2) {
var value = 123;
return {
fn1: fn1(value),
fn2: fn2(value)
}
};
var b = a(function(value){
return function() {
/**!
* 微信内置浏览器的Javascript API,功能包括:
*
* 1、分享到微信朋友圈
* 2、分享给微信好友
* 3、分享到腾讯微博
* 4、隐藏/显示右上角的菜单入口
* 5、隐藏/显示底部浏览器工具栏
* 6、获取当前的网络状态
*
@guo-yu
guo-yu / parser.js
Created January 24, 2014 16:19
a simple url parser demo
var maps = {
'weibo': 'fa-weibo'
}
var parse = function(url) {
var a = document.createElement('a');
a.href = url;
return a;
}
@guo-yu
guo-yu / deps.js
Created November 24, 2013 17:11
a simple dependency injector example
var Depender = require('depender');
dep = new Depender;
dep.define('text', '123');
dep.define('text2', 'demo222222');
dep.define('functionOne', function(msg) {
console.log(msg);
});
dep.use(function(text2, text, functionOne, nonce) {
@guo-yu
guo-yu / app.js
Created November 24, 2013 17:09
just require express-scaffold as a server
var server = require('express-scaffold');
// init a new server running on default port 3000
new server({
name: "just another express app",
desc: "some desciption here",
database: {
name: "expressdemo"
}
})
(function ($) {
var rules = document.styleSheets[document.styleSheets.length-1].cssRules;
for (var idx = 0, len = rules.length; idx < len; idx++) {
$(rules[idx].selectorText).each(function (i, elem) {
elem.style.cssText += rules[idx].style.cssText;
});
}
$('style').remove();
$('script').remove();
})(jQuery);