Skip to content

Instantly share code, notes, and snippets.

View lovubuntu's full-sized avatar
🎯
Focusing

Prabu K lovubuntu

🎯
Focusing
  • https://www.quintype.com
  • Chennai
View GitHub Profile
Level 1 https://gist.github.com/anonymous/c9d83c2c1ecc7bfe501c
Level 9 https://gist.github.com/anonymous/3796e00c851b18011d39
Level 10 https://gist.github.com/anonymous/561aca26c35f8d060083
Level 11 https://gist.github.com/anonymous/23173aad302f28029e9f
@lovubuntu
lovubuntu / links_gone_thro
Last active August 29, 2015 14:02
This is a gist of links that I found interesting and gone thro
@lovubuntu
lovubuntu / Intellij Shortcuts
Created December 16, 2014 09:27
Intellij Shorcuts I learnt
To create a new file in Intellij:
1. press ⌘+1 to get to project view
2. Now move up or down to select the package
3. Press Control+N to create a new file
to get the first value of ` set<E> someSet;` its better to use `someSet.iterator.next()` than converting it to arraylist or array and then getting the first element
There are lots of tcsh commands that help you navigate around when playing in the terminal.
Ctrl-a : back to begining of line
Ctrl-e: end of line
Ctrl-k: kills everything from the cursor to the end of line
Ctrl-b: moves cursor back (like the back arrow, but you don't have to move your hand as much)
Ctrl-f: moves the cursor forward
tab: completes the filename you are typing, very useful if you also set an environment
variable in your ~username/.tcshrc file like this "set autolist" alone on a line. Try the tab with
and without the environment variable. If you hate the beeping, put this environment variable
@lovubuntu
lovubuntu / psql_commands_history.md
Last active February 7, 2023 20:06
History for psql commands

There's no history in the database itself, if you're using psql you can use "\s" to see your command history there.

You can get future queries or other types of operations into the log files by setting log_statement in the postgresql.conf file. What you probably want instead is log_min_duration_statement, which if you set it to 0 will log all queries and their durations in the logs. That can be helpful once your apps goes live, if you set that to a higher value you'll only see the long running queries which can be helpful for optimization (you can run EXPLAIN ANALYZE on the queries you find there to figure out why they're slow).

Another handy thing to know in this area is that if you run psql and tell it "\timing", it will show how long every statement after that takes. So if you have a sql file that loo

Scope

Lexical Scope

Two forces that can cheat lexical scope:

  1. Eval - By allowing the user to create/modify variables by passing in a string to eval
  2. With - By creating a new variable in the whole new lexical scope (inside the containing function scope)

most of the optimizations the javascript engine does will be pointless if there is eval() or with. So it simply doesn't perform the optimizations at all #long live lexical scope

@lovubuntu
lovubuntu / bo.ot
Created May 18, 2016 07:39
Initial Setup
install brew
brew install zsh --> upgrade to latest version of zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
install agnoster-paradox theme
install powerline fonts if missing
https://raw.githubusercontent.com/skwp/dotfiles/master/iTerm2/Solarized%20Dark.itermcolors
@lovubuntu
lovubuntu / ci setup
Created February 9, 2017 11:21
jenkins setup
# Adding user to sudo list
usermod -aG sudo username
https://www.digitalocean.com/community/tutorials/how-to-create-a-sudo-user-on-ubuntu-quickstart
@lovubuntu
lovubuntu / jenkins_install.sh
Last active February 9, 2017 19:06
Jenkins install script
wget -q -O — https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c ‘echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list’
sudo apt-get update
sudo apt-get install jenkins