HTTP GET request body

I was developing a RESTful API. When done with the basic select/insert/update, I needed to implement endpoints for batch queries. All of a sudden, I was like, how do I pass in the list of ids? Is there some standards out there? I was thinking of using POST. That was how I did it back then, simple and easy. But with the REST philosophy, or the http way of things, I wanted to stick with GET. ...

February 9, 2018 · 2 min · birdchan

Thousands comma numeric formatting in psql

[code] select trim(both ’ ’ from to_char(12345678.49, ‘999,999,999.99’)) [/code] The trim is to take away the white space from the sides. Ref: https://www.postgresql.org/docs/9.6/static/functions-formatting.html

February 8, 2018 · 1 min · birdchan

Deep-copying in JavaScript

Good stuff. http://dassur.ma/things/deep-copy/

January 30, 2018 · 1 min · birdchan

Meltdown and Spectre

Meltdown Meltdown breaks the most fundamental isolation between user applications and the operating system. This attack allows a program to access the memory, and thus also the secrets, of other programs and the operating system. Spectre Spectre breaks the isolation between different applications. It allows an attacker to trick error-free programs, which follow best practices, into leaking their secrets. In fact, the safety checks of said best practices actually increase the attack surface and may make applications more susceptible to Spectre ...

January 23, 2018 · 1 min · birdchan

pip install pycurl

I ran pip install pycurl and got crazy error [code] Collecting pycurl Downloading pycurl-7.43.0.1.tar.gz (195kB) 100% |████████████████████████████████| 204kB 6.0MB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File “/tmp/pip-build-msc3b_98/pycurl/setup.py”, line 104, in configure_unix stdout=subprocess.PIPE, stderr=subprocess.PIPE) File “/usr/lib/python3.5/subprocess.py”, line 947, in __init__ restore_signals, start_new_session) File “/usr/lib/python3.5/subprocess.py”, line 1551, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: ‘curl-config’ During handling of the above exception, another exception occurred: ...

January 19, 2018 · 2 min · birdchan

ADT Theft Protection Guarantee

From ADT’s website: https://www.adt.com/specials Theft Protection Guarantee If a burglary occurs while your ADT security system is armed, weʼll pay up to $500* of your insurance deductible. *Subject to terms and conditions of the Residential Services Contract. Um…

January 16, 2018 · 1 min · birdchan

OperationalError: (psycopg2.OperationalError) SSL SYSCALL error: EOF detected

This seems to be an OOM exception, thus leads to db disconnection. OperationalError: (psycopg2.OperationalError) SSL SYSCALL error: EOF detected Retrying with exponential backoff could help. Ref: https://stackoverflow.com/questions/24130305/postgres-ssl-syscall-error-eof-detected-with-python-and-psycopg https://github.com/psycopg/psycopg2/issues/533 https://dba.stackexchange.com/questions/175085/postgresql-ssl-syscall-error-eof-detected

January 16, 2018 · 1 min · birdchan

Blue Laws

I was chatting with co-workers over blue laws. I never heard of blue laws so this sounds very interesting. It turns out there are states that cannot buy/sell alcohol on sundays. I am still not sure where the ‘blue’ came from. Ref: http://www.historylink.org/File/9057 https://www.theguardian.com/commentisfree/2013/mar/03/no-sunday-alcohol-sales-states-prohibition https://en.wikipedia.org/wiki/Blue_laws_in_the_United_States https://www.britannica.com/topic/blue-law http://www.todayifoundout.com/index.php/2014/12/blue-laws-come/

January 11, 2018 · 1 min · birdchan

Get comfortable with being uncomfortable - Luvvie Ajayi

https://embed.ted.com/talks/luvvie_ajayi_get_comfortable_with_being_uncomfortable https://www.ted.com/talks/luvvie_ajayi_get_comfortable_with_being_uncomfortable/

December 3, 2017 · 1 min · birdchan

Learn Git Branching

A nice game to learn git. https://learngitbranching.js.org/

October 28, 2017 · 1 min · birdchan