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:a6df11528f80f7dc42cf
Created December 3, 2015 23:56
bash shortcut memory
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
<!-- /#study-information -->
{# <div id="participant-information">#}
{# <h3>Participant Information</h3>#}
{# <form id="participant-info-form">#}
{# <label>Gender</label>#}
{# <div class="checkbox">#}
{# <label>#}
{# <input type="checkbox" name="gender[male]" value="true" data-unchecked-value="false" checked/>Male#}
{# </label>#}
@erinwan
erinwan / error.js
Created November 15, 2015 16:31
ajax handle form error
$("div.errorlist").remove();
//console.log(response.hasOwnProperty("errors"));
if (response.hasOwnProperty("errors")) {
//console.log(response["errors"]);
$commentInputFormRightDiv = $("li[class='post-item post-comment active'][data-post-id='" + postID + "'] div.row.post-comment-submit div.post-div-right");
for (var key in response["errors"]) {
$commentInputFormRightDiv.append($("<div>").html(response["errors"][key]).addClass("errorlist"));
}
@erinwan
erinwan / zsh.md
Last active August 29, 2015 14:26 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@erinwan
erinwan / gist:902659def2d1415a7efa
Created April 17, 2015 05:02
Python create superuser
./manage.py createsuperuser
@erinwan
erinwan / gist:17c32c66c1be198fa65d
Created April 16, 2015 19:50
Use virtual venv
virtualenv --no-site-packages env
source env/bin/activate
pip install -r requirements.txt
python monospace/manage.py syncdb
python monospace/manage.py runserver
https://github.com/stripe/monospace-django
dd - delete line
Ndd - delete the following N lines
@erinwan
erinwan / gist:8871acb59f2e330f5572
Created April 14, 2015 21:25
Command line copy file

cp source destination

e.g. cp ~/Desktop/MyFile.rtf ~/Documents

@erinwan
erinwan / gist:3f8c7d5a0756ba38945e
Created April 1, 2015 17:10
prompt user for input scanner in Java
Scanner scanner = new Scanner(System.in);
System.out.println("Please enter input");
String input = scanner.nextLine();
scanner.close();