Skip to content

Instantly share code, notes, and snippets.

Avatar

Yoz Grahame yozlet

View GitHub Profile
@threepointone
threepointone / feature-flags.md
Last active Apr 30, 2021
Feature flags: why, how, all that
View feature-flags.md

(I'm enjoying doing these raw, barely edited writeups; I hope they're useful to you too)

Feature flags

This is my own writeup on feature flags; for a deep dive I'd recommend something like Martin Fowler's article (https://martinfowler.com/articles/feature-toggles.html).

So. Feature flags. The basic idea that you'll store configuration/values on a database/service somewhere, and by changing those values, you can change the user experience/features for a user on the fly.

Let's say that you're building a new feature, called 'new-button' which changes the color of buttons, which is currently red, to blue. Then you'd change code that looks like this -

anonymous
anonymous / debugging.txt
Created May 11, 2016
Standard debugging email help
View debugging.txt
Hello, I'm glad you contacted me asking for help. In order to help you help
yourself I have crafted this fine little automated email with information and
things you should try before asking for help. When you run into a problem I
want you to do the following things before you email me, and then email me your
answers. Doing this will most likely help you solve the problem on your own,
and will save me time in the long run. If after doing this you are truly
stuck and you can answer all these questions then email me your answers and
I'll help you.
1. Do you have a screenshot of the error you are getting?
@shawnbot
shawnbot / form-save.js
Last active Apr 21, 2021
A JavaScript snippet for temporarily saving and restoring a form's state after refreshing
View form-save.js
// NOTE: the '#form-id' selector below will most certainly be different
// for whatever page you're on. Remember to change it in both instances!
// run this in the terminal to save the state of your form
// in your browser's LocalStorage:
[].forEach.call(document.querySelector('#form-id').elements, function(el) {
localStorage.setItem(el.name, el.value);
});
// then refresh the page and run this to restore your form values:
View Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@0xabad1dea
0xabad1dea / singularthey.md
Last active Aug 14, 2020
Singular They in Technical English
View singularthey.md

Guidelines for Singular They in Technical English

by 0xabad1dea, December 2014

This document is an RFC of sorts for increasing the adoption rate of Singular They in technical English. This is not an ultimatum; this is not shaming anyone who has done otherwise; and this is definitely not applicable to any other language.

What is Singular They?

View regex-weburl.js
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//