Skip to content

Instantly share code, notes, and snippets.


Menuka Warushavithana menuka94

View GitHub Profile
menuka94 /
Created May 12, 2021 — forked from zaloogarcia/
Script for converting Pandas DF to Spark's DF
from pyspark.sql.types import *
# Auxiliar functions
# Pandas Types -> Sparks Types
def equivalent_type(f):
if f == 'datetime64[ns]': return DateType()
elif f == 'int64': return LongType()
elif f == 'int32': return IntegerType()
elif f == 'float64': return FloatType()
else: return StringType()
menuka94 / Count lines in Git repo
Created Jul 13, 2020 — forked from mandiwise/Count lines in Git repo
A command to calculate lines of code in all tracked files in a Git repo
View Count lines in Git repo
// Reference:
$ git ls-files | xargs wc -l

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

# extracted from http//
# under public domain terms
country_bounding_boxes = {
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)),
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)),
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)),
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)),
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)),
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)),
menuka94 / grep-proxy-authorization.out
Last active Aug 1, 2019
Output of "cat wire-logs | grep "Proxy-Authorization"
View grep-proxy-authorization.out
[2019-07-25 17:12:03,844] DEBUG - wire HTTP-Sender I/O dispatcher-8 << "Proxy-Authorization: Basic YWRtaW46YWRtaW4=[\r][\n]"
[2019-07-25 17:12:03,847] DEBUG - wire HTTP-Sender I/O dispatcher-4 << "Proxy-Authorization: Basic [0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][\r][\n]"
[2019-07-25 17:12:03,848] DEBUG - wire HTTP-Sender I/O dispatcher-12 << "Proxy-Authorization: Basic [0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][\r][\n]"
[2019-07-25 17:12:03,856] DEBUG - wire HTTP-Sender I/O dispatcher-6 << "Proxy-Authorization: Basic YWRtaW46YWRtaW4=[\r][\n]"
[2019-07-25 17:12:03,859] DEBUG - wire HTTP-Sender I/O dispatcher-5 << "Proxy-Authorization: Basic YW[0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][\r][\n]"
[2019-07-25 17:12:03,860] DEBUG - wire HTTP-Sender I/O dispatcher-12 << "Proxy-Authorization: Basic YWRtaW46YWRtaW4=[\r][\n]"
[2019-07-25 17:12:03,858] DEBUG - wire HTTP-Sender I/O dispatcher-3 << "Proxy-Authorizat
menuka94 / axis2.xml
Last active Apr 3, 2019
Netty Transport - WSO2 EI 6.4.0
View axis2.xml
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><!--
~ Copyright (c) 2016, WSO2 Inc. ( All Rights Reserved.
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
menuka94 /
Last active Feb 11, 2019 — forked from phillipgreenii/
Running NPM Scripts through maven

I am in the process of introducing single page applications to where I work. For development, using node based build tools is much easier for the single page applications. However, the build process for our organization is based upon maven. Our solution started with the maven plugin frontend-maven-plugin. It worked great at first, but then we ran into a situation that I couldn't make work with it.

As stated before, at our organization, we have the older ecosystem which is maven and the newer ecosystem which is node. Our goal was to keep the hacking to a minimum. We did this by putting all of the hacks into a single super node based build file. This is what maven calls and the reason frontend-maven-plugin wasn't sufficient. The super node based build script calls all of the other build scripts by spawning npm run. Try as I might, I could not figure out how to make the spawn work. front-end-maven-plugin downloads npm

View gist:dd44e9bf770052fd2fc745f127a99cba
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.2-fpm
sudo apt-get install -y php7.2
sudo apt-get -y install curl php7.2-pgsql php7.2-curl php7.2-json php7.2-mbstring php7.2-gd php7.2-intl php7.2-xml php7.2-imagick php7.2-redis php7.2-zip
# sudo systemctl disable apache2
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
View vue-data-binding-1.html
<!DOCTYPE html>
<html lang="en" xmlns:v-on="" xmlns:v-bind="">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">