Skip to content

Instantly share code, notes, and snippets.

Working from home

Modern Monk immonk

Working from home
View GitHub Profile
immonk / Dockerfile
Last active Jul 2, 2021
Dockerfile : Stop writing your Dockerfile
View Dockerfile
# The tag here should match the Meteor version of your app, per .meteor/release
FROM geoffreybooth/meteor-base
# Copy app package.json and package-lock.json into container
COPY ./app/package*.json $APP_SOURCE_FOLDER/
# Copy app source into container
immonk /
Created May 2, 2020
Installing nodejs in linux box
# Installing nodejs using nvm
# Download script from git
curl -o- | bash
# Execute script & insatall nvm
. ~/.nvm/
# List remote versiobn
# clone
git clone
# list branches
git branch -a
# switch to branch
git checkout master
# discard changes
immonk /
Created Apr 29, 2020
Maven Cheats
# Use multiple threads for install and build
mvn -T 1C install
# clean
mvn clean
# run spring app
mvn spring-boot:run
# test
immonk /
Created Apr 28, 2020
Feign Custom Decoder Sample
import com.jayway.jsonpath.JsonPath;
import com.jayway.jsonpath.ReadContext;
import feign.FeignException;
import feign.Response;
import feign.gson.GsonDecoder;
import net.minidev.json.JSONArray;
import net.minidev.json.JSONObject;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
immonk / postgre.sql
Created Oct 24, 2019
Postgres Utility
View postgre.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
View compound-query.js
var citiesRef = db.collection("cities");
var query = citiesRef.where("capital", "==", true);
citiesRef.where("state", "==", "CA")
citiesRef.where("population", "<", 100000)
citiesRef.where("name", ">=", "San Francisco")
.where("state", "==", "CA")