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 / 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
@NaiveCAI
NaiveCAI / # macvim - 2016-06-01_17-48-14.txt
Created June 1, 2016 09:49
macvim on Mac OS X 10.11.4 - Homebrew build logs
Homebrew build logs for macvim on Mac OS X 10.11.4
Build date: 2016-06-01 17:48:14
@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 / 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 / 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
#cVim-command-bar, #cVim-command-bar-mode, #cVim-command-bar-input, #cVim-command-bar-search-results,
.cVim-completion-item, .cVim-completion-item .cVim-full, .cVim-completion-item .cVim-left,
.cVim-completion-item .cVim-right {
font-family: Helvetica, Helvetica Neue, Neue, sans-serif, monospace, Arial;
font-size: 11pt !important;
-webkit-font-smoothing: antialiased !important;
}
#cVim-command-bar {
position: fixed;
@NaiveCAI
NaiveCAI / traffic_light.rb
Last active December 3, 2018 08:46
Traffic light class refactor
# Original code
class TrafficLight
# Change to a new state
def change_to(state)
@state = state
end
def signal
case @state