Skip to content

Instantly share code, notes, and snippets.

View shafiahmed's full-sized avatar
💭
I may be slow to respond.

Shafi Ahmed shafiahmed

💭
I may be slow to respond.
View GitHub Profile
@shafiahmed
shafiahmed / README.md
Created February 7, 2021 16:39 — forked from ctsrc/README.md
How to run FreeBSD 13.0-BETA1 for ARM64 in QEMU on Apple Silicon Mac (MacBook Pro M1, etc)
@shafiahmed
shafiahmed / python.md
Created October 12, 2019 20:40 — forked from RobertAKARobin/python.md
Python Is Not A Great Programming Language

Python is not a great programming language

Let me start off by saying what is nice about Python:

  • The philosophy of "one correct way to do things."
  • Easy to learn (at the start).
  • Pretty complete standard libraries.
  • A huge ecosystem of good third-party libraries.
  • Forced indentation. It's a mixed bag, but I've worked with too many junior developers who would never have indented otherwise.
  • The import system makes it easy to trace the filepath for any dependency.
###
### script to detect objects in live video
### using MobileNets+SDD
###
### by: memeka <mihailescu2m@gmail.com>
###
import argparse, json
import time, datetime, threading
import numpy, cv2
@shafiahmed
shafiahmed / nginx.conf
Created April 25, 2018 10:06 — forked from ddre54/nginx.conf
NGINX configuration to detect and redirect unsupported browsers
# # IE 10 +
# # Firefox 27 +
# # Safari 7 +
# # iOS Safari 5 +
# # IE mobile 10 +
# # Android 4.2 +
# # Blackberry 10 +
# # Chrome 31+
#
@shafiahmed
shafiahmed / emt_allocation.ipynb
Created April 4, 2018 19:44 — forked from rtbs-dev/emt_allocation.ipynb
Virginia Beach EMT Allocation exploration
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shafiahmed
shafiahmed / pmml_bayesnet.ipynb
Created April 4, 2018 19:43 — forked from rtbs-dev/pmml_bayesnet.ipynb
Bayesian Network Models in PyMC3 and NetworkX
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1. Separation of immutable and mutable logic

Quite a lot of different people have been on the same trail of thought. Gary Bernhardt's formulation of a "functional core, imperative shell" seems to be the most voiced.

"Boundaries" - Gary Bernhardt

"Imperative shell" that wraps and uses your "functional core".. The result of this is that the shell has fewer paths, but more dependencies. The core contains no dependencies, but encapsulates the different logic paths. So we’re encapsulating dependencies on one side, and business logic on the other side. Or put another way, the way to figure out the separation is by doing as much as you can without mutation, and then encapsulating the mutation separately. Functional core — Many fast unit tests. Imperative shell — Few integration tests

https://www.youtube.com/watch?v=yTkzNHF6rMs