Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block DarwinniwraD

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
DarwinniwraD /
Created Jan 3, 2018 — forked from davfre/
git commandline cheat-sheet
DarwinniwraD /
Last active Nov 24, 2017 — forked from alexpchin/
Create a new repository on the command line

Setting up a new Git Repo

##Create a new repository on the command line

git init
git add
git commit -m "first commit"
git remote add origin<username>/<reponame>.git
DarwinniwraD / git_merge_local.txt
Last active May 23, 2017 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
View git_merge_local.txt
git fetch --all
git reset --hard origin/master
git pull origin master
View 关于js复制的几种方法.md


众所周知,js中复制包括浅复制(Shallow Clone)和深复制(Deep Clone)两种,深复制的出现主要针对复杂数据结构,如数组和对象,其中浅复制就是运用赋值运算方式(“=”),为新对象引用所有的源对象属性,这不会产生新的对象,只是一个对象引用(reference)。而深复制则相对复杂一些,它是将所有的原始数据类型,机器所有的对象引用复制到新的对象中,这种复制最终会形成两个对象.关于两种复制的方法的论述已经有许多了,无外乎有以下三种:

  1. 第三方库,如underscore.js,jquery, loadsh

  2. JSON大法

  3. js原生方法

  4. 关于第三方库的复制方法

  1. jQuery
View Div居中的种种方法
//This is a complete guide for centering a div with CSS.
//1.Centering in CSS: A Complete Guide(
//2.How To Center Anything With CSS(
//3.CSS layout: tricks and layout techniques in ‘Learn CSS Layout’(
//4.Absolute Centering(
View jQueryPluginPatterns.js
A (very) WIP collection of optimized/recommended jQuery plugin patterns
from @addyosmani, @cowboy, @ajpiano and others.
Whilst the end-goal of this gist is to provide a list of recommended patterns, this
is still very much a work-in-progress. I am not advocating the use of anything here
until we've had sufficient time to tweak and weed out what the most useful patterns
You can’t perform that action at this time.