Skip to content

Instantly share code, notes, and snippets.

View fjcero's full-sized avatar

Francisco Caballero fjcero

View GitHub Profile

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:

@fjcero
fjcero / webpack.nginx.conf
Created February 3, 2017 16:37 — forked from SiZapPaaiGwat/webpack.nginx.conf
webpack-dev-server configuration in nginx on development server
upstream ws_server {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name 10.1.2.225;
location / {
proxy_pass http://ws_server/;
@fjcero
fjcero / README.md
Created July 26, 2016 17:19 — forked from einfallstoll/README.md
Reset Spotlight Location (Fix for OS X 10.11 El Capitan)

Installation for GUI Users

  1. Right click the file and choose information and choose to always open this file with Terminal.app

  2. Go to the Terminal.app and do something like this chmod 744 Reset Spotlight.sh

  3. There you go, you can now double click it so reset the Spotlight location

  4. Optional: Uncomment line for the useCount to prevent Spotlight to forget that you already used it

@fjcero
fjcero / README.md
Created June 8, 2016 22:54 — forked from hilios/README.md
ngPageTitle - AngularJS page title service

$pageTitle

Allows to control the page title from the AngularJS route system, controllers or any other component through an injectable service.

ngPageTitle - Page title service (run tests)

To get started add the module to your app and configure the page title provider:

@fjcero
fjcero / handler.js
Created March 16, 2016 22:45 — forked from ThisIsMissEm/handler.js
The better way to execute Go on Amazon Lambda (see: http://blog.0x82.com/2014/11/24/aws-lambda-functions-in-go/)
var child_process = require('child_process');
exports.handler = function(event, context) {
var proc = spawn('./test', [ JSON.stringify(event) ], { stdio: 'inherit' });
proc.on('close', function(code){
if(code !== 0) {
return context.done(new Error("Process exited with non-zero status code"));
}
@fjcero
fjcero / ingress-crawl-portal-level.js
Created November 6, 2015 20:05 — forked from teckl/ingress-crawl-portal-level.js
Ingress portal level crawler with PhantomJS.
/**
* @file Ingress portal level crawler with PhantomJS
* @author teckl (https://github.com/teckl)
* @version 0.0.1
* @license MIT
* @see {@link https://github.com/nibogd/tg-ingress-scorebot|GitHub }
* @see {@link https://github.com/jonatkins/ingress-intel-total-conversion|GitHub }
*/
"use strict";
@fjcero
fjcero / what-forces-layout.md
Created September 28, 2015 20:14 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@fjcero
fjcero / gist:4844c65fde536302a154
Created September 25, 2015 13:40 — forked from alexcrown/gist:089971889fda0ca4e7b1
Jasig CAS auth in angular webapp
$scope.login = function () {
$http({ // getting TGT (Ticket Granting Ticket)
method: 'POST',
url: 'http://localhost/cas/v1/tickets',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: $.param({username: $scope.loginform.username, password: $scope.loginform.password})
}).success(function(data, status, headers) {
// CAS returns location where we can request service ticket
var location = headers('Location');
$http({ //requesting service ticket, rest/app/heartbeat is part of our app
@fjcero
fjcero / Gruntfile.js
Last active September 10, 2015 15:57 — forked from nnarhinen/Gruntfile.js
Support html5 pushState (or angular.js html5mode) in a yeoman (grunt-contrib-connect) application.
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
//MODIFIED: add require for connect-modewrite
var modRewrite = require('connect-modrewrite');
grunt.initConfig({
@fjcero
fjcero / megaNumber.js
Last active August 29, 2015 14:24 — forked from timgit/megaNumber.js
angular.module('utilsModule').filter("megaNumber", () => {
return (number, fractionSize) => {
if(number === null) return null;
if(number === 0) return "0";
if(!fractionSize || fractionSize < 0)
fractionSize = 1;
var abs = Math.abs(number);