Skip to content

Instantly share code, notes, and snippets.

Jasdeep Khalsa jasdeepkhalsa

Block or report user

Report or block jasdeepkhalsa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View elm-starter.elm
import Html exposing (..)
type alias Model = { ... }
jasdeepkhalsa / jenkinsfile-stage.groovy
Last active Jul 10, 2019
Adding a stage into a Jenkins file
View jenkinsfile-stage.groovy
stage('Lint') {
steps {
sh 'npm run lint'
jasdeepkhalsa /
Last active May 15, 2019
Complex git rebase strategies (using --rebase-merges)

Firstly make sure you're using a decent editor with your git e.g. Atom, VS Code etc.

git config --global core.editor "atom"

To modify a merge commit history, like the merges done by popular online version control systems such as GitLab or Bitbucket:

¢ git rebase --rebase-merges -i HEAD~1
jasdeepkhalsa / triggerEventIE8+.js
Created Feb 20, 2019
triggerEvent dispatch fire trigger events cross browser IE8 compatible
View triggerEventIE8+.js
function triggerEvent(elem, eventType) {
const noop = () => {}
if ('createEvent' in document) {
// modern browsers, IE9+
const evt = document.createEvent('HTMLEvents') || new Event(eventType);
evt.initEvent ? evt.initEvent(eventType, true, false) : noop();
jasdeepkhalsa /
Created Jan 9, 2019
Video to GIF with FFMPEG
ffmpeg -i video.mp4 -filter_complex "[0:v] fps=24,scale=1080:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" video.gif
jasdeepkhalsa / numberToWords.js
Last active Dec 28, 2018
Number to Words Convertor
View numberToWords.js
import { toWords } from 'number-to-words';
export function numberToWords(number) {
if (!number || number === true) {
return number;
const numWithNoNonDigits = number.replace ? number.replace(/\D/g,'') : number;
const numToArray = numWithNoNonDigits.toString().split('');
jasdeepkhalsa /
Last active Nov 6, 2018
Extract a value from a file of key=value pairs using BASH
VAR=$(grep "MyVar" test | grep "^$MyVar" | cut -d'=' -f2-)
echo $VAR
jasdeepkhalsa /
Created Oct 18, 2018
Quickest Way to Show/Hide Hidden Files on MacOS

Since macOS Sierra, when in Finder, you can use the shortcut:

jasdeepkhalsa / log.js
Created Oct 11, 2018
console.log Log Wrapper using ES6 Rest & Spread Syntax
View log.js
function log(...args) {
jasdeepkhalsa /
Created Oct 5, 2018
Flattening SVGs into One Layer / Path
You can’t perform that action at this time.