Skip to content

Instantly share code, notes, and snippets.

Avatar
🐦

Dustin Deus StarpTech

🐦
View GitHub Profile
@pdxjohnny
pdxjohnny / .gitignore
Last active Sep 23, 2020
Setting Up k3s for Serverless (knative) on a $5 DigitalOcean Droplet Using k3d
View .gitignore
.terraform/
*.pem
*.tf
*.tfstate
*.yaml
*.backup
istio-*/
cert-manager-*/
*.swp
env
@jaydenseric
jaydenseric / RouteIndicator.mjs
Last active Nov 13, 2020
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
bvaughn / index.md
Last active Nov 26, 2020
How to use profiling in production mode for react-dom
View index.md
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) {
buffer.push(data)
cb(null, data)
},
@pteich
pteich / main.go
Last active Nov 20, 2020
Example for using go's sync.errgroup together with signal detection signal.Notify to stop all running goroutines
View main.go
package main
import (
"context"
"errors"
"fmt"
"os"
"os/signal"
"syscall"
"time"
@nodkz
nodkz / .babelrc.js
Last active Sep 15, 2020
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 = [
View gist:f25075f03f87c669025854f99e14f836
minikube start --vm-driver=xhyve --container-runtime=docker --show-libmachine-logs --v=10 --alsologtostderr --cpus 4 --memory 8192
@ahmetb
ahmetb / gcrgc.sh
Last active Nov 23, 2020
Script to clean up Google Container Registry images pushed before a particular date
View gcrgc.sh
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@jashmenn
jashmenn / self-eq-this-vs-bind.md
Last active Nov 1, 2020
Javascript var self = this; vs. .bind
View self-eq-this-vs-bind.md

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
stephenway / README.md
Last active Sep 4, 2020
BEMIT Cheatsheet
View README.md
You can’t perform that action at this time.