Skip to content

Instantly share code, notes, and snippets.

View tarqd's full-sized avatar

Christopher Tarquini tarqd

View GitHub Profile
@tarqd
tarqd / feature-flag.service.ts
Last active December 12, 2024 18:52 — forked from cookavich/feature-flag.service.ts
LaunchDarkly feature flag service in Angular using RxJS
import { Injectable, OnDestroy } from '@angular/core';
import { environment } from '@environments/environment';
import * as LaunchDarkly from 'launchdarkly-js-client-sdk';
import { LDFlagValue } from 'launchdarkly-js-client-sdk';
import { Observable, Subject } from 'rxjs';
import { map } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})

When should I not use feature flags?

Feature flags work great for use-cases that require these properties:

Dynamic

  • Feature flag changes are propagated to SDKs in under 200ms without restarting the application

Contextual

@tarqd
tarqd / LICENSE.md
Last active November 11, 2021 05:20
Tagged Tuples

The MIT License (MIT)

Copyright (c) 2015 Christopher Tarquini

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@tarqd
tarqd / indego.rs
Last active January 20, 2020 05:35 — forked from jnschaeffer/indego.rs
Indego CSV parsing
use std::env;
use std::error::Error;
use std::process;
use csv::Reader;
use serde::Deserialize;
#[derive(Debug, Deserialize)]
enum PassholderType {
Indego30,
[
{
"resources": [
"proj/<PROJ-NAME>"
],
"actions": [
"*"
],
"effect": "allow"
},
openapi: 3.0.1
info:
version: 4.0.1
title: Linode API
x-logo: {
url: '/linode-logo.svg',
backgroundColor: '#fafafa'
}
description: |
# Introduction
from click import globals
from cookiecutter import repository, vcs, utils, cli, config
from cookiecutter.config import get_user_config
from jinja2.ext import Extension
import sys
import os
def get_zip_dir(clone_dir, template):
if repository.is_repo_url(template):
identifier = zip_uri.rsplit('/', 1)[1]

Recovery Instructions

  • Open the Terminal (Finder -> Applications -> Utilities -> Terminal)
  • Type the command: find / -name "*.doc" -or -name "*.docx" 2>/dev/null and press enter. This may take a while

You should now have a list of all doc or docx files on the system, even temporary or autosave ones. If you see it then type open in the terminal and press enter. This should open that file in Word.

@tarqd
tarqd / signals.hpp
Last active November 13, 2016 17:58
Slimmer Signals
/**
* Slimmer Signals
* Inspired by Boost::Signals2 and ssig
*
* Main Differences between this library and all the other signal libraries:
* - Light-weight: No unessarry virtual calls besides the ones inherit with std::function
* - Uses vectors as the underlying storage
* The theory is that you'll be emitting signals far more than you'll be adding slots
* so using vectors will improve performance greatly by playing nice with the CPUs cache and taking
* advantage of SIMD
@tarqd
tarqd / mysql_check.sh
Created September 24, 2016 21:28
MySQL Vulnerability Security Checker
#!/bin/bash
# Try and find where my.cnf are loaded from, otherwise guess
MYSQLD_OUT=$(mysqld --help --verbose 2>/dev/null)
DATADIR=$(echo "$MYSQLD_OUT" | grep "datadir " | tr -s ' ' | cut -d' ' -f 2)
DATADIR=${DATADIR:=/var/lib/mysql}
FILES=$(echo "$MYSQLD_OUT" | awk 'f{print;f=0} /Default options are read/{f=1}')
FILES=${FILES:=/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf}
FILES="$FILES $DATADIR/my.cnf $DATADIR/.my.cnf"