Skip to content

Instantly share code, notes, and snippets.

...human in progress

Praveen Puglia praveenpuglia

...human in progress
View GitHub Profile

nvm vs Volta

A comparison of nvm and Volta to manage Node.js projects (without Yarn).

Bootstrap Project with nvm

nvm install
sw-yx / react-router-state-manager.jsx
Last active Jul 26, 2022
Sync your state to your query params for copy-pastable state-in-URLs. React Router, Gatsby, and Svelte versions
View react-router-state-manager.jsx
// note - this was my rough working prototype, but still left some artifacts in the query params.
// todo: also need to debounce the history pushes
// see comments for production Gatsby and Svelte versions which delete nondefault keys in the query params
import React from 'react'
import queryString from "query-string"
export const connectRouterState = defaultURLState => Component => props => {
const { history, location } = props
// note: do not nest objects in URL state
larryyangsen / download.js
Created May 28, 2018
axios download audio file
View download.js
const { data } = await axios.get(url, {
responseType: 'arraybuffer',
headers: {
'Content-Type': 'audio/wav'
const blob = new Blob([data], {
type: 'audio/wav'
praveenpuglia / webpack.config.js
Last active Apr 11, 2018
Simplest webpack 4 configuration to work with vuejs & scss
View webpack.config.js
// Require things!
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
// The configuration starts here!
module.exports = {
// The entry point for webpack to start generating a dependency graph.
entry: { index: './src/index.js' },
praveenpuglia / debug.component.ts
Created Mar 23, 2018
Simple Component that dumps prettified data in any template.
View debug.component.ts
import { Component, Input } from '@angular/core';
selector: 'dump',
template: `
<pre><code>{{data | json}}</code></pre>
styles: [
:host {
praveenpuglia /
Last active Sep 14, 2022
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.


Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional


bradens / slack-dark-theme.css
Last active Feb 1, 2019
Dark theme for slack
View slack-dark-theme.css
#msgs_scroller_div::-webkit-scrollbar-track, #client_body::before, .client_container,
#search_terms, #client_body, #footer, ts-message, .channel_header, ts-jumper ts-jumper-container,
ts-jumper input[type="text"] {
background: #282c34 !important;
#client_body::before {
border-bottom: 1px solid #1a2129 !important;
MarkTiedemann /
Last active Jul 18, 2021
An Easier Way to Enforce Required Parameters in ES6

An Easier Way to Enforce Required Parameters in ES6

Expands on Handling required parameters in ECMAScript 6 by Axel Rauschmayer.

The idea (which is credited to Allen Wirfs-Brock) is, in essence, to use default parameter values to call a function which throws an Error if the parameter is missing:

const throwIfMissing () => { throw new Error('Missing parameter') }
iambibhas / facebook_url_redirect_avoid.js
Last active Nov 20, 2015
UserScript to avoid Facebook's URL director
View facebook_url_redirect_avoid.js
// ==UserScript==
// @name Facebook URL Redirector Bypass
// @namespace in.bibhas
// @include https://**
// @version 1
// @grant none
// ==/UserScript==
si = window.setInterval(clearanchors, 2000);
function clearanchors(){
anchors = document.getElementsByTagName('a');