Skip to content

Instantly share code, notes, and snippets.

View ineo6's full-sized avatar
🎯
Focusing

ineo6 ineo6

🎯
Focusing
View GitHub Profile
@nevergiveup-j
nevergiveup-j / onerror
Last active June 12, 2018 06:09
前端代码异常日志收集与监控
/**
* @param {String} msg 错误信息
* @param {String} url 出错的文件
* @param {Long} line 出错代码的行号
* @param {Long} col 出错代码的列号
* @param {Object} error 错误的详细信息,Anything
*/
window.onerror = function(msg,url,line,col,error){
//没有URL不上报!上报也不知道错误
if (msg != "Script error." && !url){
@hyle
hyle / ko.utils.3.3.0.signatures.js
Last active April 9, 2019 13:08
KnockoutJS 3.3.0 utils (ko.utils) signatures
// knockout 3.3.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
@clinyong
clinyong / build.js
Created March 11, 2016 15:38
webpack build script.
import webpack from 'webpack'
import config from './webpack'
import swig from 'swig'
import fs from 'fs'
function writeTemplate (name) {
let sourceTemplate = config.templatePath + '/prod.tmpl'
let targetTemplate = config.buildTemplatePath + '/index.tmpl'
let content = swig.renderFile(sourceTemplate, {name})
fs.writeFile(targetTemplate, content, err => {
@yulijia
yulijia / .git-commit-blog.txt
Last active August 6, 2020 14:59 — forked from Linell/.git-commit-template.txt
git commit template in Chinese
# Type(<scope>): <subject>
# <body>
# <footer>
# type字段
# add 增加新博客/页面(add new post/page)
# correct 改错别字/语法(correct spelling/grammar )
# update 更新内容(update content)
@lakoilija
lakoilija / readme.txt
Created September 2, 2020 10:57
best game 1.exe (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
/**
* For Google Voice
* @Author zbinlin <zbinlin@outlook.com>
*/
var sleep = delay => new Promise(resolve => setTimeout(resolve, delay));
var composeClick = function x(btn) {
var rect = btn.getBoundingClientRect();
var x = Math.floor(rect.clientX + rect.width * Math.random());
var y = Math.floor(rect.clientY + rect.height * Math.random());
@wohugb
wohugb / .npmrc
Last active February 3, 2022 06:25 — forked from tonyc726/.npmrc
河蟹加速npm/yarn的资源安装升级速度
registry="https://registry.npmmirror.com"
disturl="https://npmmirror.com/dist"
nvm_nodejs_org_mirror="https://npmmirror.com/mirrors/node"
nodejs_org_mirror="https://npmmirror.com/mirrors/node"
sass_binary_site="https://npmmirror.com/mirrors/node-sass"
electron_mirror="https://npmmirror.com/mirrors/electron/"
SQLITE3_BINARY_SITE="https://npmmirror.com/mirrors/sqlite3"
profiler_binary_host_mirror="https://npmmirror.com/mirrors/node-inspector/"
node_inspector_cdnurl="https://npmmirror.com/mirrors/node-inspector"
selenium_cdnurl="https://npmmirror.com/mirrors/selenium"

d3js Tree Visualizer with Search, Panning, Expand and Collapse

Overview

This example pulls together various examples of work with trees in D3.js. See the d3js Tree Visualizer live here.

Features:

  • Expanding and collapsing nodes
  • Panning
@nasirkhan
nasirkhan / zip-split-unzip.md
Last active December 21, 2023 16:26
Split a Zip file and combine and unzip next linux

You have existing.zip but want to split it into 50M sized parts.

zip existing.zip --out new.zip -s 50m

will create

new.zip
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {