Skip to content

Instantly share code, notes, and snippets.

View praveenpuglia's full-sized avatar
👨‍💻
...human in progress

Praveen Puglia praveenpuglia

👨‍💻
...human in progress
View GitHub Profile
@iambibhas
iambibhas / facebook_url_redirect_avoid.js
Last active November 20, 2015 12:55
UserScript to avoid Facebook's URL director
// ==UserScript==
// @name Facebook URL Redirector Bypass
// @namespace in.bibhas
// @include https://*.facebook.com/*
// @version 1
// @grant none
// ==/UserScript==
si = window.setInterval(clearanchors, 2000);
function clearanchors(){
anchors = document.getElementsByTagName('a');
@praveenpuglia
praveenpuglia / debug.component.ts
Created March 23, 2018 14:20
Simple Component that dumps prettified data in any template.
import { Component, Input } from '@angular/core';
@Component({
selector: 'dump',
template: `
<pre><code>{{data | json}}</code></pre>
`,
styles: [
`
:host {
@praveenpuglia
praveenpuglia / webpack.config.js
Last active April 11, 2018 17:43
Simplest webpack 4 configuration to work with vuejs & scss
// 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' },
@bradens
bradens / slack-dark-theme.css
Last active February 1, 2019 07:56
Dark theme for slack
#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;
}
@mikaelbr
mikaelbr / gulpfile.js
Created January 14, 2014 20:24
Example gulpfile for complete set-up.
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var less = require('gulp-less');
var refresh = require('gulp-livereload');
var lr = require('tiny-lr');
var server = lr();
var minifyCSS = require('gulp-minify-css');
var embedlr = require('gulp-embedlr');
@tovbinm
tovbinm / gist:2975609
Created June 22, 2012 22:47
Remove the “Last login” message from the Mac OS X Terminal
Remove:
touch .hushlogin
Get it back:
rm .hushlogin
@MarkTiedemann
MarkTiedemann / README.md
Last active July 18, 2021 11:42
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') }
@keimlink
keimlink / nvm_vs_volta.md
Last active August 19, 2021 23:19
nvm vs Volta

nvm vs Volta

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

Bootstrap Project with nvm

nvm install
@mlouro
mlouro / gulpfile.js
Last active June 21, 2022 23:20
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@swyxio
swyxio / react-router-state-manager.jsx
Last active July 26, 2022 10:43
Sync your state to your query params for copy-pastable state-in-URLs. React Router, Gatsby, and Svelte versions
// 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