Skip to content

Instantly share code, notes, and snippets.

View troy0820's full-sized avatar
💭
Thinking of a master plan....... 'Cause ain't nothin' but sweat inside my hand

Troy Connor troy0820

💭
Thinking of a master plan....... 'Cause ain't nothin' but sweat inside my hand
View GitHub Profile
@sanketsudake
sanketsudake / kind-kubernetes-metrics-server.md
Last active April 5, 2024 07:06
Running metric-server on Kind Kubernetes

I have created a local Kubernetes cluster with kind. Following are changes you need to get metric-server running on Kind.

Deploy latest metric-server release.

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.5.0/components.yaml

Within existing arguments to metric-server container, you need to add argument --kubelet-insecure-tls.

@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@HipsterBrown
HipsterBrown / .bash_profile
Last active April 30, 2019 17:55
Some handy bash functions for working in a git repo
# usage: load your local environment with a .env file or point to another file
# dotenv // load .env by default
# dotenv .env.staging // load the environment variables in .env.staging
dotenv() {
export $(cat ${1:-.env} | xargs);
}
# dynamically generate branch completion list
_list_branch_completions() {
COMPREPLY=($(compgen -W "$(git branch --list --sort=refname | tr -d '*')" "${COMP_WORDS[1]}"))
@posener
posener / go-table-driven-tests-parallel.md
Last active April 30, 2024 20:34
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()

⚠️ this is now stupidly out of date

Computers

  • 13" Macbook Pro 3.3 GHz i7 (late 2016)
  • Microsoft Surface Book (2016)

Peripherals

@betaorbust
betaorbust / README.md
Last active July 21, 2018 19:57
ES2015 fallback check for Progressive Transpilation

ES2015 Syntax Check for use with Progressive Transpilation

The attached file file spits out a string for direct injection into the head of a page, which will be a lightweight test of the ability to parse and run ES2015 syntax.

Unminified version

This is the original source for the test-case below:

class ಠ_ಠ extends Array{
@jamtur01
jamtur01 / pre-commit
Created October 18, 2016 21:54
A Terraform validation and formatting pre-commit hook
#!/usr/bin/env bash
set -e
# Formats any *.tf files according to the hashicorp convention
files=$(git diff --cached --name-only)
for f in $files
do
if [ -e "$f" ] && [[ $f == *.tf ]]; then
#terraform validate `dirname $f`
terraform fmt $f
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@diegoconcha
diegoconcha / redux_egghead_notes.md
Last active January 18, 2022 13:23
Redux Egghead.io Notes

###Redux Egghead Video Notes###

####Introduction:#### Managing state in an application is critical, and is often done haphazardly. Redux provides a state container for JavaScript applications that will help your applications behave consistently.

Redux is an evolution of the ideas presented by Facebook's Flux, avoiding the complexity found in Flux by looking to how applications are built with the Elm language.

####1st principle of Redux:#### Everything that changes in your application including the data and ui options is contained in a single object called the state tree

@mikermcneil
mikermcneil / query-multiple-models-in-sails-controller-action.js
Created September 16, 2015 19:05
Querying multiple models from a controller action in Sails
//...
showSchoolDetailPage: function (req, res) {
if (!req.param('id')) {
return res.badRequest('The id of the school (`id`) is a required parameter!');
}
// Look up the school, it's associated image, and the associated list of students.
School.findOne({
id: req.param('id')