Skip to content

Instantly share code, notes, and snippets.

Avatar
😁
Coding fun stuff....

Jaskaranbir Dhillon Jaskaranbir

😁
Coding fun stuff....
View GitHub Profile
@Jaskaranbir
Jaskaranbir / puppeteer-experiment.js
Last active Jan 30, 2020
Some basic experimentation with Puppeteer - Prints response-body and gets screenshot.
View puppeteer-experiment.js
const puppeteer = require('puppeteer');
const url = process.argv[2];
if (!url) {
throw "Please provide URL as a first argument";
}
async function run () {
const browser = await puppeteer.launch( {
headless: true
View ms-terminal-preferences.json
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"alwaysShowTabs": true,
"copyOnSelect": false,
"defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"initialCols": 120,
"initialRows": 30,
"keybindings": [
{
"keys": ["ctrl+shift+\\"],
@Jaskaranbir
Jaskaranbir / Vagrantfile_hyper-v
Created Aug 17, 2019
Vagrantfile I use for Hyper-V
View Vagrantfile_hyper-v
# -*- mode: ruby -*-
# vi: set ft=ruby :
plugin_dependencies = [
"vagrant-docker-compose",
# "vagrant-windows-hyperv"
# "vagrant-vbguest"
]
needsRestart = false
@Jaskaranbir
Jaskaranbir / ClassLoaderLeakExample.java
Created Nov 4, 2018 — forked from dpryden/ClassLoaderLeakExample.java
Example of a ClassLoader leak in Java
View ClassLoaderLeakExample.java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,
@Jaskaranbir
Jaskaranbir / github_release_script.sh
Last active Apr 3, 2020
Shell script to create GitHub releases with automatically generated changelogs (using github-changelog-generator).
View github_release_script.sh
#!/bin/bash
# ===> Set these variables first
branch="$GIT_BRANCH"
# Example: "Jaskaranbir/MyRepo"
repo_slug="$TRAVIS_REPO_SLUG"
token="$GITHUB_TOKEN"
version="$TRAVIS_TAG"
# An automatic changelog generator
@Jaskaranbir
Jaskaranbir / git_delete_local_tags.sh
Created Sep 6, 2018
Git delete tags locally that do not exist on remote
View git_delete_local_tags.sh
git fetch --prune origin "+refs/tags/*:refs/tags/*"
View kafka_docker.yaml
version: '3'
services:
kafka:
image: wurstmeister/kafka
environment:
- KAFKA_ADVERTISED_HOST_NAME=localhost
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
links:
- zookeeper
@Jaskaranbir
Jaskaranbir / docker-cleanup-resources.md
Created Jul 27, 2017 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@Jaskaranbir
Jaskaranbir / JCustomTextField.java
Created Oct 17, 2016
JTextField extension with bunch of filtering stuff that might be useful sometime
View JCustomTextField.java
import javax.swing.JTextField;
import javax.swing.event.UndoableEditEvent;
import javax.swing.event.UndoableEditListener;
import javax.swing.text.AbstractDocument;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.DocumentFilter;
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoManager;
@Jaskaranbir
Jaskaranbir / Infi-Cont-Marquee.html
Created Jul 2, 2016
Inifinite Continuous Scrolling Marquee in CSS without any explicit framework
View Infi-Cont-Marquee.html
<div id="maindiv">
<!-- Need to have two divs with same content.
One div will translate completely out of parent and other div will fill the void till the transition for first div starts again. -->
<div id="div1">
&nbsp;Test-1 Test-2 Test-3 Test-4 Test-5 Test-6 Test-7 Test-8 Test-9 Test-10 Test-11
</div>
<div id="div2">
&nbsp;Test-1 Test-2 Test-3 Test-4 Test-5 Test-6 Test-7 Test-8 Test-9 Test-10 Test-11
</div>
</div>
You can’t perform that action at this time.