Skip to content

Instantly share code, notes, and snippets.

DarwinniwraD

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

Setting up a new Git Repo

##Create a new repository on the command line

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:<username>/<reponame>.git
@DarwinniwraD
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复制的集中方法

众所周知,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.
//见过许多方法来居中div,当然有些方法因情况不同而不同
//详细可参考:
//1.Centering in CSS: A Complete Guide(https://css-tricks.com/centering-css-complete-guide/)
//2.How To Center Anything With CSS(https://codemyviews.com/blog/how-to-center-anything-with-css)
//3.CSS layout: tricks and layout techniques in ‘Learn CSS Layout’(http://book.mixu.net/css/5-tricks.html)
//4.Absolute Centering(http://codepen.io/shshaw/full/gEiDt)
View jQueryPluginPatterns.js
/*
A (very) WIP collection of optimized/recommended jQuery plugin patterns
from @addyosmani, @cowboy, @ajpiano and others.
Disclaimer:
-----------------------
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.