Skip to content

Instantly share code, notes, and snippets.

Dustin Deus StarpTech

Block or report user

Report or block StarpTech

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
jaydenseric / RouteIndicator.mjs
Last active Jun 26, 2019
A route change indicator for Next.js using React hooks.
View RouteIndicator.mjs
import Router from 'next/router'
import React from 'react'
const DONE_DURATION = 250
export const RouteIndicator = () => {
const [loading, setLoading] = React.useState(null)
const [timeoutId, setTimeoutId] = React.useState(null)
const onLoad = () => setLoading(true)
bvaughn /
Last active Oct 7, 2019
How to use profiling in production mode for react-dom
View html-cache.js
const stream = require('stream')
const cache = new Map() // you might wanna use an lru here
function createCacheStream (url) {
const buf = []
return stream.Transform({
transform: function (data, enc, cb) {
cb(null, data)
nodkz / .babelrc.js
Last active Sep 30, 2019
Babel 7.0 with .babelrc.js DEPRECATED! This config was created when babel 7 was in beta
View .babelrc.js
/* eslint-disable prefer-template */
const path = require('path');
const aliases = require('./aliases');
// ///////////////////////////////////////////////////////////////
// ////////////////// PLUGINS ////////////////////////////////
// ///////////////////////////////////////////////////////////////
const commonPlugins = [
jashmenn /
Last active Aug 13, 2019
Javascript var self = this; vs. .bind

The Problem

In Javascript this is bound in unexpected ways. Functions, in particular, create a new 'this' and so when you want to keep a reference to an "outer" object you sometimes see the pattern:

var self = this;

as in:

var self = this;
stephenway /
Last active Aug 1, 2019
BEMIT Cheatsheet
yoavniran /
Last active Oct 10, 2019
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies

ipmb / ratelimit.nginxconf
Last active May 23, 2019
Nginx reverse proxy with rate limiting
View ratelimit.nginxconf
upstream myapp {
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;
staltz /
Last active Oct 14, 2019
The introduction to Reactive Programming you've been missing
timknight / breakpoint.scss
Created May 5, 2014
A simple responsive breakpoint mixin that takes both attribute names and custom widths. See
View breakpoint.scss
@mixin breakpoint($min: 0, $max: 0) {
$type: type-of($min);
@if $type == string {
@if $min == xs {
@media (max-width: 767px) { @content; } // Mobile Devices
@else if $min == sm {
@media (min-width: 768px) { @content; } // Tablet Devices
You can’t perform that action at this time.