Skip to content

Instantly share code, notes, and snippets.

View tkalfigo's full-sized avatar

Thalis K. tkalfigo

  • Berlin, Germany
View GitHub Profile
@tkalfigo
tkalfigo / gist:ee44dbeb2b37b2802da9
Created March 4, 2015 20:01
wget wildcard file download
wget -r --no-parent -A '*.tar.gz' http://www.example.com
/******************************************************************************
How to load Javascript modules into postgres
******************************************************************************/
CREATE EXTENSION IF NOT EXISTS plv8
/******************************************************************************
First step is download the Javascript module file
Example with undescore-min and node-jpath
******************************************************************************/
@tkalfigo
tkalfigo / crosstab.sql
Created March 23, 2016 10:20 — forked from romansklenar/crosstab.sql
PostgreSQL "pivot table" example using tablefunc extension
CREATE EXTENSION tablefunc;
CREATE TABLE sales(year int, month int, qty int);
INSERT INTO sales VALUES(2007, 1, 1000);
INSERT INTO sales VALUES(2007, 2, 1500);
INSERT INTO sales VALUES(2007, 7, 500);
INSERT INTO sales VALUES(2007, 11, 1500);
INSERT INTO sales VALUES(2007, 12, 2000);
INSERT INTO sales VALUES(2008, 1, 1000);
INSERT INTO sales VALUES(2009, 5, 2500);
#! /bin/sh
# chkconfig: 2345 98 02
# description: PostgreSQL RDBMS
# File adjusted based on PGSRC/contrib/start-scripts/linux
# This is an example of a start/stop script for SysV-style init, such
# as is used on Linux systems. You should edit some of the variables
# and maybe the 'echo' commands.
#
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@tkalfigo
tkalfigo / ChromeExtensionGulp.js
Created March 28, 2017 09:05 — forked from TravelingTechGuy/ChromeExtensionGulp.js
Gulp file for building a Chrome Extension
'use strict';
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev
var gulp = require('gulp'),
clean = require('gulp-clean'),
cleanhtml = require('gulp-cleanhtml'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stripdebug = require('gulp-strip-debug'),
@tkalfigo
tkalfigo / lodashify.js
Created April 9, 2017 11:54 — forked from khalilovcmd/lodashify.js
to import lodash into chrome dev tools console
var el = document.createElement('script');
el.src = "https://raw.githubusercontent.com/lodash/lodash/3.10.1/lodash.min.js";
el.type = "text/javascript";
document.head.appendChild(el)
# pretty terminal system info
/usr/bin/neofetch
# sudocabulary [https://github.com/badarsh2/Sudocabulary]
chmod +x ~/.vocab
~/.vocab
# Add this file as ~/.git-prompt-colors.sh
# This is the custom theme template for gitprompt.sh
override_git_prompt_colors() {
GIT_PROMPT_THEME_NAME="Custom"
GIT_PROMPT_START_USER="_LAST_COMMAND_INDICATOR_ ${ResetColor} ${Yellow}${PathShort}${ResetColor}"
GIT_PROMPT_START_ROOT="${GIT_PROMPT_START_USER}"
GIT_PROMPT_END_USER=" \n${Green}[${USER}@${HOSTNAME%%.*}] ${Time12a}${ResetColor} $ "
}
@tkalfigo
tkalfigo / agg.sql
Created September 29, 2017 19:49 — forked from ryandotsmith/agg.sql
Postgres array concatenation aggregate function.
CREATE AGGREGATE array_accum (anyarray)
(
sfunc = array_cat,
stype = anyarray,
initcond = '{}'
);