#PSQL Commands
pg_dump -U dbUser --column-inserts --table=tableName
pg_dump -U dbUser --schema-only --table=tableName
pg_dump -U dbUser --data-only --column-inserts --table=tableName
string = string.replace(/\s+/g, ' '); |
Go to SublimeText 2 > Preferences > User Settings. This should open your User Settings as a JSON file. Add the following to your file:
"trim_trailing_white_space_on_save": true
<?php | |
$arr = json_decode(json_encode(simplexml_load_string($xml, null, LIBXML_NOCDATA)), true); | |
?> |
<?php | |
$a=10; $b=20; | |
list($b, $a) = array($a,$b); | |
?> |
# to get matching line and 5 lines before that | |
grep -B 5 "pattern" file | |
# to get matching line and 5 lines after that | |
grep -A 5 "pattern" file | |
# of course, you can combine -A and -B options together in single command. That's obvious. | |
# if your -A and -B values are same, you need not specify both the options. use -C instead. | |
grep -C 5 "pattern" file |
Programming Laguages | |
PHP - currenly my bread and butter is earned with this language only | |
Javascript | |
Ruby | |
Editors | |
Eclipse, with PDT - on ubuntu as well as windows. This is my preferred editor | |
vim - only when working on terminal | |
nodepad++ - only when working on windows | |
Sublime Text 2 - trying this editor on linux as well as windows | |
Source Code Control |
<?php | |
$sum = 0; | |
for ($i = 0; $i < 1000; $i++) { | |
if (!($i % 3) || !($i % 5)) { | |
$sum += $i; | |
} | |
} | |
echo $sum; | |
?> |
<?php | |
$n1 = 1; | |
$n2 = 1; | |
$n3 = $n1 + $n2; | |
$sum = 0; | |
while($n3 < 4000000) { | |
$sum += $n3; | |
$n1 = $n2 + $n3; | |
$n2 = $n1 + $n3; | |
$n3 = $n1 + $n2; |