Skip to content

Instantly share code, notes, and snippets.

Yixin Wan erinwan

Block or report user

Report or block erinwan

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
View gist:a6df11528f80f7dc42cf
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
View temp.html
<!-- /#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 Nov 15, 2015
ajax handle form error
View error.js
$("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 Aug 29, 2015 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
View zsh.md

Prereq:

apt-get install zsh
apt-get install git-core

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
View gist:902659def2d1415a7efa
./manage.py createsuperuser
View gist:17c32c66c1be198fa65d
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
View gist:d71f7d0cbcbac7a5b3ca
dd - delete line
Ndd - delete the following N lines
View gist:8871acb59f2e330f5572

cp source destination

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

@erinwan
erinwan / gist:3f8c7d5a0756ba38945e
Created Apr 1, 2015
prompt user for input scanner in Java
View gist:3f8c7d5a0756ba38945e
Scanner scanner = new Scanner(System.in);
System.out.println("Please enter input");
String input = scanner.nextLine();
scanner.close();
You can’t perform that action at this time.