Skip to content

Instantly share code, notes, and snippets.

Building AI

Michael iMerica

Building AI
  • Obscura
  • NYC
Block or report user

Report or block iMerica

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
iMerica /
Created Apr 18, 2019
Quick and dirty Performance Metrics using only Curl
#!/usr/bin/env bash
# I found this in my ZSH profile and I forgot where I got it from. If you wrote it, Thanks!
curl -so /dev/null -w " namelookup: %{time_namelookup}s\n connect: %{time_connect}s\n appconnect: %{time_appconnect}s\n pretransfer: %{time_pretransfer}s\n redirect: %{time_redirect}s\nstarttransfer: %{time_starttransfer}s\n-------------------------\n total: %{time_total}s\n" "$@"
iMerica /
Last active Apr 2, 2019
A Pattern for Auth based Routing using Redux, React Router

A Pattern for Auth based Routing using Redux, React Router


  • Token based authentication or JWT. This one is good for Django Rest Authentification.
  • The first line of defense in protecting sensitive data is your REST API and its auth system, not your React SPA. This solution is just for intelligent routing, not protecting sensitive data.
  • Redux or equivalent state management framework that allows you to easily connect components to a single source of truth state.


If you're familiar with the React concept of "lifting state up",

iMerica / index.js
Created Dec 28, 2018
Django/DRF File Uploading to S3
View index.js
const notifyDjango = (url) => {
// Record the URL of the file you've uploaded along with any data
// that is relevent to you.
const uploadToS3 = (file, url) => {
// Upload the file here
// See as a great example of handling all S3 upload edge cases.
iMerica /
Last active Dec 20, 2018
CLI Fizz Buzz One Liner
#!/usr/bin/env bash
# MIT License
# Copyright (c) 2018 @iMerica (Michael)
# 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
iMerica / functional-utils.js
Created Dec 11, 2018 — forked from bendc/functional-utils.js
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
View functional-utils.js
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
iMerica /
Last active Sep 7, 2018
Custom Auth for Django/DRF that allows for multiple API Tokens per user.
from rest_framework.authentication import TokenAuthentication
from .models import RESTAPIToken
class CustomRestAPIAuthentication(TokenAuthentication):
""" Custom Authentication """
def get_model(self):
return RESTAPIToken
iMerica / filter.js
Last active Jul 30, 2018
Work At A Startup Job Filter
View filter.js
const findJobs = (remote, min_salary) => {
return window.TOP_LEVEL_PROPS.companies.filter(
company =>
job => ((job.remote_ok === remote) && (job.salary_max >= min_salary))
).length > 0
iMerica / docker-compose.yml
Last active Jan 14, 2019
Gitlab Docker Runners
View docker-compose.yml
version: '2'
restart: always
privileged: true
- /var/lib/docker
image: docker:18.06.0-ce-dind
- --storage-driver=overlay2
iMerica /
Created Jul 20, 2018
Job Offer Decision Making Framework
from dataclasses import dataclass
from typing import Sequence
This is a proof of concept framework for selecting job offers.
The general idea is to remove emotions from the decision
making process and first think about whats important to you, then
compare each offer against those factors.
iMerica / .gitlab-ci.yml
Last active Jul 18, 2018
Automated Deployments of Create React Apps to Cloudfront using Scotty JS.
View .gitlab-ci.yml
image: docker:latest
- docker:dind
- build
- push
- deploy
You can’t perform that action at this time.