Skip to content

Instantly share code, notes, and snippets.

View mtheoryx's full-sized avatar
🐳
Making happy little clouds

David Poindexter mtheoryx

🐳
Making happy little clouds
View GitHub Profile
@threepointone
threepointone / feature-flags-client-implementation.md
Last active June 1, 2023 18:35
Implementing a client for feature flags

On implementing a client for feature flags in your UI codebase

This document isn't an explainer on Feature Flags, you can find that with my amateur writeup, or literally hundreds of better writeups out there.

This document is also agnostic to the choice of service you'd use: LaunchDarkly or split.io or optimizely or whatever; that's orthogonal to this conversation.

Instead, this document is a list of considerations for implementing a client for using Feature Flags for User Interface development. Service providers usually give a simple fetch and use client and that's it; I contend that there's a lot more to care about. Let's dive in.

To encourage usage, we'd like for the developer experience to be as brutally simple as possible. So, this should be valid usage:

@jaredpsimpson
jaredpsimpson / hex.c
Created March 28, 2019 21:04
HEX to split RGB
// Get rid of '#' and convert it to integer
long int number = strtol(&command[0], NULL, 16);
// Split them up into r, g, b values
int red = number >> 16;
int green = number >> 8 & 0xFF;
int blue = number & 0xFF;
@threepointone
threepointone / for-snook.md
Last active August 26, 2023 15:43
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

Early Voting in Indianaapolis

Election Day: Tuesday, November 6th, 2018

7 Early Voting Locations in Indianapolis

Marion County Clerk's Office

Location

const createLogger = (backgroundColor, color) => {
const logger = (message, ...args) => {
if (logger.enabled === false) {
return;
}
console.groupCollapsed(
`%c${message}`,
`background-color: ${backgroundColor}; color: ${color}; padding: 2px 4px;`,
...args
@shortjared
shortjared / list.txt
Last active April 28, 2024 07:20
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@mjackson
mjackson / Dockerfile
Created October 13, 2017 00:30
Running `gatsby develop` on a container in development
FROM node:8
WORKDIR /home/node/app
ADD https://github.com/Yelp/dumb-init/releases/download/v1.1.1/dumb-init_1.1.1_amd64 /usr/local/bin/dumb-init
RUN chmod +x /usr/local/bin/dumb-init
COPY package.json yarn.lock ./
RUN yarn --pure-lockfile
COPY . .
@zkat
zkat / index.js
Last active March 10, 2024 14:32
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@mtheoryx
mtheoryx / packages.txt
Created June 2, 2017 12:25
It's dependency managers all the way down.
How can I get jQuery?
Install it with Bower (a package manager)
How can I get Bower?
Install it with yarn (a package manager)
How can I get yarn?
Install it with npm (a package manager)
How can I get npm?
Install it with nvm (node version manager)
How can I get nvm?
Install it with Homebrew (a mac package manager)
@wassname
wassname / natural-webpack.js
Created April 3, 2016 09:16
Importing natural into webpack (the node nlp toolkit)
/*
Importing natural into webpack (the node nlp toolkit)
This is just copy of natural's index.js with some exports commented out.
This way it works in webpack, however I haven't full tested it.
*/
exports.SoundEx = require('natural/lib/natural/phonetics/soundex');
exports.Metaphone = require('natural/lib/natural/phonetics/metaphone');
exports.DoubleMetaphone = require('natural/lib/natural/phonetics/double_metaphone');