Skip to content

Instantly share code, notes, and snippets.

View gxcsoccer's full-sized avatar
🎯
Focusing

zōng yǔ gxcsoccer

🎯
Focusing
View GitHub Profile
@gxcsoccer
gxcsoccer / reflow.js
Created September 3, 2012 18:26
bootstrap re-flow snippet
that.$element.show();
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element.addClass('in');
@gxcsoccer
gxcsoccer / manager.go
Created October 15, 2012 17:35
删除数组中某一个元素,并返回删除的元素地址
package library
import (
"errors"
"fmt"
)
type MusicEntry struct {
Id string
Name string
@gxcsoccer
gxcsoccer / gist:4504426
Created January 10, 2013 18:17
seajs define function
define(function(require, exports, module) {
// The module code goes here
});
/** the full version **/
define(id, deps, function(require, exports, module) {
// The module code goes here
@gxcsoccer
gxcsoccer / gist:5325491
Created April 6, 2013 09:06
Delete keys by pattern using REDIS-cli
redis-cli -n 0 KEYS prefix* | xargs redis-cli DEL
<div>
<a href="{{protocol}}//{{host}}{{pathname}}">{{protocol}}//{{host}}{{pathname}}</a>
</div>
<script>
function Template(node) {
var prototype = document.createDocumentFragment();
prototype.appendChild(node);
@gxcsoccer
gxcsoccer / class.js
Created February 2, 2018 09:46
各种类构造和继承性能比较
'use strict';
const Benchmark = require('benchmark');
const benchmarks = require('beautify-benchmark');
const suite = new Benchmark.Suite();
const util = require('util');
const assert = require('assert');
class A {
@gxcsoccer
gxcsoccer / class_1.js
Created February 2, 2018 09:47
一层继承
'use strict';
const Benchmark = require('benchmark');
const benchmarks = require('beautify-benchmark');
const suite = new Benchmark.Suite();
const util = require('util');
const assert = require('assert');
class A {
@gxcsoccer
gxcsoccer / class_2.js
Created February 2, 2018 09:50
两层继承
'use strict';
const Benchmark = require('benchmark');
const benchmarks = require('beautify-benchmark');
const suite = new Benchmark.Suite();
const util = require('util');
const assert = require('assert');
class A {
@gxcsoccer
gxcsoccer / class_3.js
Created February 2, 2018 09:51
三层继承
'use strict';
const Benchmark = require('benchmark');
const benchmarks = require('beautify-benchmark');
const suite = new Benchmark.Suite();
const util = require('util');
const assert = require('assert');
class A {