Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯

Eric Yang eyanq

🎯
  • ap-southeast-2
  • 07:17 (UTC +10:00)
View GitHub Profile
@eyanq
eyanq / postgres_util.sql
Created April 11, 2017 08:33
Useful PostgreSQL Queries
View postgres_util.sql
-- get last week first day and last week last day
SELECT
(to_date(concat(EXTRACT(YEAR FROM CURRENT_DATE),EXTRACT(week FROM CURRENT_DATE - '1 week' :: INTERVAL)),'iyyyiw'))::text AS start_date,
(to_date(concat(EXTRACT(YEAR FROM CURRENT_DATE),EXTRACT(week FROM CURRENT_DATE - '1 week' :: INTERVAL)),'iyyyiw') + 6)::text AS end_date
;
@eyanq
eyanq / helloworld.py
Created May 23, 2014 02:15 — forked from jookyboi/python_resources.md
Python-related modules and guides.
View helloworld.py
def hello():
print "Hello, GistBox!"
@eyanq
eyanq / 0_reuse_code.js
Created May 23, 2014 02:15
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console