Skip to content

Instantly share code, notes, and snippets.

View JacobWay's full-sized avatar

Jacob Way JacobWay

View GitHub Profile
@JacobWay
JacobWay / PostgreSQL knowledge base.txt
Last active March 9, 2017 09:26
PostgreSQL knowledge base
Install PostgreSQL:
Install PostgreSQL 9.6 via homebrew.
Before installation:
Uninstall PostgreSQL if you have installed it by homebrew with command: brew uninstall postgres.
Delete the database cluster, usually locates on /usr/local/var/postgres, or /usr/local/pgsql/data.
The command is: rm -rf /usr/local/var/postgres, or rm -rf /usr/local/pgsql/data.
@JacobWay
JacobWay / about_this.js
Created December 27, 2016 08:09
JavaScript code example of this in anonymous, callback, arrow function, es6, es5
{
class Message {
doCallback(cb){
cb("!!");
}
doAnother(){
console.log("??", this); // Message
}
doSomething() {
this.doCallback(function(message){
@JacobWay
JacobWay / custom_js_event.js
Last active April 11, 2016 08:30
The older approach to creating events uses APIs inspired by JAVA
// create event
var evt = document.createEvent("Event");
// initializing the event
evt.initEvent("anyName", true, true);
// add event handler
document.addEventListener("anyName", function(e){
// your handler logic
console.log("e.target: ", e.target);
function Foo(){
return this;
}
var fooThis = Foo(); // ? fooThis =
var fooThat = new Foo(); // ? fooThat =
@JacobWay
JacobWay / .gitignore
Last active August 29, 2015 14:15 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #