Skip to content

Instantly share code, notes, and snippets.

View NaiveCAI's full-sized avatar
🎹
A CRUD programmer,钢琴业余0级爱好者,价值投资门口的赌徒。

Tracy Cai NaiveCAI

🎹
A CRUD programmer,钢琴业余0级爱好者,价值投资门口的赌徒。
  • Xometry
  • Shanghai
View GitHub Profile
@NaiveCAI
NaiveCAI / pgsql-query-json-array.sql
Created November 23, 2017 08:53 — forked from clarkdave/pgsql-query-json-array.sql
(PostgreSQL) Query something in a JSON array in a WHERE clause
-- when you have a record which looks like this
--
-- id: 5,
-- properties: {
-- ages: [20, 30]
-- }
--
-- it is a bit of a pain if you need to query based on the contents of the "ages" array inside the JSON object "properties"
-- because PG currently lacks easy to use operators to work with JSON arrays
@NaiveCAI
NaiveCAI / 0_reuse_code.js
Created April 12, 2017 01:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@NaiveCAI
NaiveCAI / Monaco for Powerline.otf
Created October 10, 2016 01:27 — forked from baopham/Monaco for Powerline.otf
Patched font Monaco for OSX Vim-Powerline
@NaiveCAI
NaiveCAI / iterm.scpt
Created May 31, 2016 00:02 — forked from gnachman/iterm.scpt
Fix docker quickstart terminal for iTerm2 version 2.9 and later
on write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as string
set the open_target_file to open for access file target_file with write permission
if append_data is false then set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
on error
try