Skip to content

Instantly share code, notes, and snippets.

View hassanrehman's full-sized avatar

hassan abdul rehman hassanrehman

View GitHub Profile
@hassanrehman
hassanrehman / TabulaServer.java
Created July 16, 2019 08:24
To create a local endpoint which receives parameters like that of command line, but runs the JVM only once
package com.company;
import technology.tabula.*;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.ParseException;
import com.sun.net.httpserver.HttpExchange;
@hassanrehman
hassanrehman / pgadmin4_autoload_changes.js
Last active April 20, 2018 10:39
Adds a button next to BOLT query runner, to reload the file from the filesystem so that the user can change the file in an external editor and re-run the query
//NOTE: use CJS plugin on chrome to append this additional js ...
//TODO: ability to have multiple files present, and the current one to be selected from dropdown
//TODO: memory to keep the list safe
//TODO: file picker to get new instead of manually typing the paths
window.auto_query_config = {
file_path: '/path/to/file.sql'
autoload_file: false
}
@hassanrehman
hassanrehman / extensions.rb
Created March 26, 2018 17:06
Ability to use left_joins with ActiveRecord
module ActiveRecord
module QueryMethods
#keeping track of left joins sent
attr_accessor :left_joins_values
#photocopy of joins except for the variable that records left_joins separate from the joins
def left_joins(*args)
return self if args.compact.blank?