Skip to content

Instantly share code, notes, and snippets.

Hsun linkgod

Block or report user

Report or block linkgod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@linkgod
linkgod / custom-WebStorm-VM-options
Created Jun 20, 2017
custom WebStorm VM options
View custom-WebStorm-VM-options
# custom WebStorm VM options
-server
-Xms2048m
-Xmx4096m
-XX:MaxPermSize=1024M
-XX:ReservedCodeCacheSize=1024M
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC
@linkgod
linkgod / cloudSettings
Last active Mar 11, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-03-11T08:02:17.362Z","extensionVersion":"v3.2.7"}
@linkgod
linkgod / table-footbal-rank.js
Created Jul 2, 2015
桌上足球Rank排名算法
View table-footbal-rank.js
var playersMap = {
"舒克": 1200,
"迟伤": 1200,
"沙陀": 1200,
"皓勋": 1200,
"圣耀": 1200,
"懂象": 1200,
"青也": 1200,
"呼荣": 1200
};
@linkgod
linkgod / randomChildGenerator.js
Last active Aug 29, 2016
随机截取一个列表中的元素,返回列表
View randomChildGenerator.js
/*
* @description 获取一个list孩子随机生成器
* @param {Array} list 列表
* @param {Array} shown 已经显示过的项目
* @return {Function} list随机孩子的列表生成器,执行之后返回一个随机孩子列表
* */
function randomChildGenerator(list) {
var listProduct = list,
listCustom = [];
View javascript range.js
function range(len){
return Array.apply(null, Array(len)).map(function (v,k) { return k });
}
View gist:8412866
// type detect
utils.is = function(obj, type) {
return Object.prototype.toString.call(obj).slice(8, -1) === type;
};
View Converts svg to png.js
// Converts a given word cloud to image/png.
function downloadPNG() {
var canvas = document.createElement("canvas"),
c = canvas.getContext("2d");
canvas.width = w;
canvas.height = h;
c.translate(w >> 1, h >> 1);
c.scale(scale, scale);
words.forEach(function(word, i) {
c.save();
View Gruntfile.js
module.exports = function(grunt){
grunt.initConfig({
pkg:grunt.file.readJSON("package.json"),
less:{
//必包含的less文件,合并到内的,合并的文件的内容会比component内的文件内容先出现
options:{
concat:true, //合并
paths:"source/less",//路径
imports:{
less:["basic.less"]//需要合并的less文件名
@linkgod
linkgod / changes arguments to "true" array.js
Last active Dec 21, 2015
changes arguments to "true" array
View changes arguments to "true" array.js
var argsArr = Array.prototype.slice.call(arguments);
// changes arguments to "true" array
// 把 arguments 转换成一个“真正的”数组
var nodesArr = Array.prototype.slice.call(document.querySelectorAll("div"));
// "true" array of DIVs
// 得到一个由 div 元素组成的“真正的”数组
// document.querySelectorAll("div")得到的不是一个类数组
@linkgod
linkgod / just a simple picture.html
Last active Dec 20, 2015
just a simple picture
View just a simple picture.html
<!DOCTYPE html>
<html>
<head>
<title>ABC</title>
<style type="text/css">
.round{
display: inline-block;
height: 100px;
width: 100px;
border-radius: 100px;
You can’t perform that action at this time.