This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# TODO: you will need to have conda installed | |
# create a python environment | |
conda create -n env_tmp python=3.8.13 -y | |
# activate environment | |
conda activate env_tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Free f a = | |
Return a | | |
forall e . Bind (Free f e) (e -> Free f a) | | |
LiftF (f a) | |
instance Monad (Free f) where | |
return = Return | |
(>>=) = Bind | |
liftF :: f a -> Free f a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S ::= S S S | |
| S S | |
| 'a' | |
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
O(n^3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Functional programming utilities for python | |
""" | |
from __future__ import absolute_import, division, print_function, unicode_literals | |
# pylint: disable=redefined-builtin | |
from collections import defaultdict | |
from copy import copy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GOAL: On a CentOS 6.7 minimal install, set up nginx as a reverse proxy to uWSGI Emperor with python 2.7.11 as a plugin to run Flask apps | |
# ::NOTE:: All instructions below are run as a sudoer, not as root. Talk to your sysadmins if you're not a sudoer. | |
# Install bare essentials: | |
sudo yum install -y epel-release | |
sudo yum groupinstall 'Development Tools' | |
sudo yum install -y vim openssl unzip nginx openssl-devel zlib-devel sqlite-devel bzip2-devel libffi-devel lapack-devel blas-devel libpng-devel freetype-devel | |
# Set SELINUX=disabled in the file below, and reboot, or this tutorial will get unnecessarily complicated: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object STRef { | |
/** | |
* Here is a container where we have a single "state thread" = ST. | |
* When we run this thread of type ST[T] we get a result of type T. | |
*/ | |
sealed abstract class ST[+T] { | |
def map[R](fn: T => R): ST[R] = flatMap(t => Const(fn(t))) | |
def flatMap[R](fn: T => ST[R]): ST[R] = FlatMapped(this, fn) | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.