git log --pretty=format: --name-only | sort | uniq -c | sort -rg | lessLiterally copied from the answer of "Finding most changed files in git"
Tuesday, June 16, 2015
Sort file name by number of changes in git history
Tuesday, June 9, 2015
[PostgreSQL] Using some indexes from Composite index
If we had a composite index on three fields: we would be able to use it for queries on the first field, for queries on the first two fields and for queries involving all three fields, but not on any other field combination.Copied directly from How to stop worrying and love your Postgres indexes
Monday, May 25, 2015
[PostgreSQL] List running queries
In psql, run this command
You might also what to order the result by query_start or state_changeselect * from pg_stat_activity where datname = YOUR_DB_NAME and state = 'active'
Saturday, April 4, 2015
Start lein repl with test profile
When you try to run lein repl with test profile, you'll get warning/error message similar to this.
To fix this error, you can use the feature that lein provided combining profile like so;
$ lein with-profile test repl
Warning: no nREPL dependency detected.
Be sure to include org.clojure/tools.nrepl in :dependencies of your profile.
...
Error loading clojure.tools.nrepl.server: Could not locate clojure/tools/nrepl/server__init.class or clojure/tools/nrepl/server.clj on classpath:
Error loading complete.core: Could not locate complete/core__init.class or complete/core.clj on classpath:
Exception in thread "main" java.lang.ClassNotFoundException: clojure.tools.nrepl.server, compiling:(/private/var/folders/7d/98yf91rn0yz6wbh56h5q7rkh0000gn/T/form-init2792809345387087761.clj:1:1340)The reason is because unlike default profile, tools.nrepl isn't added as dependency for test profile. You can verify this by comparing the output between lein pprint (or lein with-profile default pprint) and lein with-profile test pprint.
To fix this error, you can use the feature that lein provided combining profile like so;
$ lein with-profile default,test replWith the command above, lein should start the repl without any errors.
Friday, March 27, 2015
[VIM] Not jumping to half of the screen when scroll to the right (horizontally) in a long line
:set sidescroll=1
Credit: In vim, how to scroll horizontally, by just one character, when cursor reaches end of the window? [duplicate]
Thanks @iporsut for triggered my curiosity
Credit: In vim, how to scroll horizontally, by just one character, when cursor reaches end of the window? [duplicate]
Thanks @iporsut for triggered my curiosity
Set bash completion when aliasing docker to d
After you installed docker bash completion, either by sourcing it from your .bash_profile or installing it to bash-completion, add this line to the end of your docker-completion.sh file.
Note: change the last d to other character you aliased docker to
complete -F _docker dReload your shell. And that's it!
Note: change the last d to other character you aliased docker to
Thursday, March 12, 2015
[VIM] Move screen before cursor reaching top or bottom
It's interesting that I didn't realize I had been living without this feature for years as a vim user. Thanks to @tenderlove and @searls for publishing their vim setup session video. In the beginning of this video, @tenderlove adds set scrolloff=2 to vimrc. scrolloff is a good config that everyone who's using vim should have in their vimrc.
What it does is to tell vim to move screen before cursor reaching 2 top or bottom lines (2 is an arbitrary number). Give it a try. I bet you'll like it.
I went observe on JetBrains' IDE, they are configured to behave the same with setting scrolloff=1 on vim.
What it does is to tell vim to move screen before cursor reaching 2 top or bottom lines (2 is an arbitrary number). Give it a try. I bet you'll like it.
I went observe on JetBrains' IDE, they are configured to behave the same with setting scrolloff=1 on vim.
Subscribe to:
Posts (Atom)
Collectd PostgreSQL Plugin
I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresq...
-
sudo su postgres supply your Mac password modify /Library/PostgreSQL/9.x/data/pg_hba.conf from local all all md5 to local all all ...
-
This error occurs when you or some of your vim plugins try to access register '*' which is a system clipboard. In default Mac OSX vi...
-
Put your cursor on the text box of the post/comment you want to indent Go to the menubar at the top of the screen Edit > Emoji & ...