Skip to content

Instantly share code, notes, and snippets.

View mamonu's full-sized avatar
🎯
Focusing

Theodore M mamonu

🎯
Focusing
View GitHub Profile
@mamonu
mamonu / macOS Internals.md
Created May 7, 2023 05:42 — forked from kconner/macOS Internals.md
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@mamonu
mamonu / find-latest-ami.sh
Created July 29, 2022 17:40 — forked from daveadams/find-latest-ami.sh
Find latest Amazon deep learning AMI
#!/usr/bin/env bash
# Find the latest Amazon-created "Deep Learning AMI (Ubuntu 18.04)" AMI image ID
#
# args explanation:
# --region us-east-1
# Specifies the AWS region (you can also specify it in your
# ~/.aws/config or via the `AWS_REGION` or `AWS_DEFAULT_REGION`
# env vars)
#
@mamonu
mamonu / python-django-postgres-ci.yml
Created November 17, 2019 01:32 — forked from jefftriplett/python-django-postgres-ci.yml
This is a good starting point for getting Python, Django, Postgres running as a service, pytest, black, and pip caching rolling with GitHub Actions.
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
@mamonu
mamonu / monoids-and-reductions.md
Last active May 2, 2018 12:44 — forked from ludflu/monoids-and-reductions.md
Monoids and map-side reductions using Spark's aggregateByKey

In a classic hadoop job, you've got mappers and reducers. The "thing" being mapped and reduced are key-value pairs for some arbitrary pair of types. Most of your parallelism comes from the mappers, since they can (ideally) split the data and transform it without any coordination with other processes.

By contrast, the amount of parallelism in the reduction phase has an important limitation: although you may have many reducers, any given reducer is guaranteed to receive all the values for some particular key.

So if there are a HUGE number of values for some particular key, you're going to have a bottleneck because they're all going to be processed by a single reducer.

However, there is another way! Certain types of data fit into a pattern:

  • they can be combined with other values of the same type to form new values.
  • the combining operation is associative. For example, integer addition: ((1 + 2) + 3) == (1 + (2 + 3)) - they have an identity value. (f
@mamonu
mamonu / AliasSampling.ipynb
Created February 12, 2018 02:10 — forked from jph00/AliasSampling.ipynb
Fast weighted sampling using the alias method in numba
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mamonu
mamonu / nord_modular_osx.md
Created April 26, 2017 17:28 — forked from arirusso/nord_modular_osx.md
Use the original Nord Modular Editor with OSX

Use the original Nord Modular Editor with OSX

Required

  • Homebrew

Compatibility

Confirmed working with

@mamonu
mamonu / cluster_example.py
Created October 21, 2016 22:36 — forked from xim/cluster_example.py
Clustering K-Means by euclidian distance, yay!
import sys
import numpy
from nltk.cluster import KMeansClusterer, GAAClusterer, euclidean_distance
import nltk.corpus
from nltk import decorators
import nltk.stem
stemmer_func = nltk.stem.EnglishStemmer().stem
stopwords = set(nltk.corpus.stopwords.words('english'))

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@mamonu
mamonu / actor.scala
Created May 22, 2016 00:53
IntelliJ IDEA Live Template for an Akka actor
import akka.actor.{ Actor, Props }
object $NAME$ {
def props: Props = Props(new $NAME$)
}
class $NAME$ extends Actor {
override def receive = ???
}