Skip to content

Instantly share code, notes, and snippets.

View javikalsan's full-sized avatar
🍄

javikalsan javikalsan

🍄
View GitHub Profile
@javikalsan
javikalsan / Postgresql Import dump file to local database
Last active May 11, 2018 16:27
Postgresql Import dump file to local database
psql -U postgres -W -d database_name -f my_dump_file.sql -h localhost
@javikalsan
javikalsan / linux users executing system proceses
Created February 13, 2014 07:44
linux users executing system proceses
ps aux | cut -d " " -f1 | sort | uniq | grep -v USER
@javikalsan
javikalsan / PHPDoc-function.sublime-snippet
Created February 11, 2014 12:46
PHPDoc Sublime Text 2 snippet
<snippet>
<content><![CDATA[/**
* ${4:undocumented function}
*
* @param $7
* @return ${5:void}
* @author ${PHPDOC_AUTHOR:$TM_FULLNAME}$6
*
**/
$1function $2($3)
@javikalsan
javikalsan / apache mod_pagespeed sample code
Created February 10, 2014 17:49
apache mod_pagespeed sample configuration
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedFileCachePath /var/mod_pagespeed/cache/
# Direct Apache to send all HTML output to the mod_pagespeed output handler.
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
# Turn this on if /var/mod_pagespeed/cache/ is on a ext3 filesystem.
ModPagespeedSharedMemoryLocks on
@javikalsan
javikalsan / postgis_ha_trigger.txt
Created February 10, 2014 11:20
Trigger for postgis to calculate geometry area on hectares
SELECT AddGeometryColumn('geoms', 'the_geom', 25830, 'MULTIPOLYGON', 2 );
Trigger sup. ha
BEGIN
IF (TG_OP = 'INSERT') THEN
NEW.supha := area(NEW.the_geom)/10000;
ELSIF (TG_OP = 'UPDATE') THEN
IF NOT (NEW.the_geom ~= OLD.the_geom) THEN
NEW.supha := area(NEW.the_geom)/10000;