Skip to content

Instantly share code, notes, and snippets.

View erinwan's full-sized avatar

Yixin Wan erinwan

  • Mountain View, CA
View GitHub Profile
@erinwan
erinwan / gist:cda3141a843710e95bfe
Last active August 29, 2015 14:13
git globally ignore a folder

Create a global .gitignore

git config --global core.excludesfile ~/.gitignore_global

Inside this file, add:

[folderNameToIgnore]/

@erinwan
erinwan / gist:920e466464abe1a62a1d
Last active August 29, 2015 14:13
git ignore a file temporarily

To make Git not track this file temporarily:

git update-index --assume-unchanged [filename]

To make Git track the file again, simply run:

git update-index --no-assume-unchanged [filename]

@erinwan
erinwan / gist:78b7f5e28f850a68a1d8
Last active August 29, 2015 14:13
What is the difference between POST and GET?

GET and POST are two different types of HTTP requests.

According to Wikipedia:

GET requests a representation of the specified resource. Note that GET should not be used for operations that cause side-effects, such as using it for taking actions in web applications. One reason for this is that GET may be used arbitrarily by robots or crawlers, which should not need to consider the side effects that a request should cause. and

POST submits data to be processed (e.g., from an HTML form) to the identified resource. The data is included in the body of the request. This may result in the creation of a new resource or the updates of existing resources or both.

So essentially GET is used to retrieve remote data, and POST is used to insert/update remote data.

@erinwan
erinwan / gist:8754a0d48b53605f967a
Created January 20, 2015 20:20
html form first input auto selected
<!-- autofocus -->
<input type="text" id="inputUserName" name="username" required="required" autofocus="autofocus">
@erinwan
erinwan / gist:44dbc8e2c552bde26d0b
Created January 27, 2015 06:54
git undo last commit
@erinwan
erinwan / gist:4f78f1dbaa1920f1861c
Created January 29, 2015 01:36
open finder of current folder from command line

open .

@erinwan
erinwan / gist:b128ae017bdd7caaf446
Created February 1, 2015 03:42
Jetbrains products Git integration with local Git repo
"VCS" - "Git Integration"
@erinwan
erinwan / gist:ed1cad2c200032c68de5
Created February 1, 2015 05:11
git modify commit message
git commit --amend -m "New commit message"
@erinwan
erinwan / gist:5407f9ff67216e824227
Created February 3, 2015 20:05
Shortcut to clear command line terminal