Skip to content

Instantly share code, notes, and snippets.

View naturallymitchell's full-sized avatar

Mitchell Tannenbaum naturallymitchell

View GitHub Profile
@naturallymitchell
naturallymitchell / hello-emoji.cpp
Created June 15, 2022 18:12 — forked from abusse/hello-emoji.cpp
Some C++ Emoji fun found on the internet. Compiles (currently) only with clang (sorry GCC) and C++11.
#include <iostream>
#include <vector>
#include <cstdlib>
namespace 🔵 = std;
using 🔢 = int;
using 💯 = unsigned;
using 💀 = void;
using 🕖 = time_t;
using 👌 = bool;
@naturallymitchell
naturallymitchell / dht-walkthrough.md
Created May 24, 2022 20:37 — forked from gubatron/dht-walkthrough.md
DHT walkthrough notes

DHT Walkthrough Notes

I've put together these notes as I read about DHT's in depth and then learned how the libtorrent implementation based on the Kademlia paper actually works.

What problem does this solve?

400,000,000,000 (400 billion stars), that's a 4 followed by 11 zeros. The number of atoms in the universe is estimated to be around 10^82. A DHT with keys of 160 bits, can have 2^160 possible numbers, which is around 10^48

@naturallymitchell
naturallymitchell / ann-pu-speakeasy
Created June 6, 2020 03:19
[ANN] Come use The Speakeasy Solution Stack Rust engine: Torchbear for fast, safe, simple, and complete(R) scripting
From [Patchwork University](https://github.com/patchworkuniversity), [Torchbear](https://github.com/patchworkuniversity/torchbear) makes low-level programming fully extensible with a high-level, simple syntax for blessed components in ecosystem libraries. [The Speakeasy Solution Stack](https://github.com/patchworkuniversity/speakeasy) benefits from Torchbear's simple keyword functions for Rust's powerful libraries. It makes for a great open source programming environment<->ecosystem culture!
The [Lighttouch](https://github.com/patchworkuniversity/lighttouch) application framework and [ContentDB](https://github.com/patchworkuniversity/contentdb) database are 2 foundational programs of Speakeasy. They have already been used as a [content management framework (CMF)](https://en.wikipedia.org/wiki/List_of_content_management_systems) and [low-code programming](https://en.wikipedia.org/wiki/Low-code_development_platform), like what you can see as [ContentDB models generate interfaces using Speakeasy's Lighttouch
@naturallymitchell
naturallymitchell / tailwind.md
Created May 23, 2020 23:35 — forked from sandren/tailwind.md
Tailwind CSS best practices

Tailwind CSS best practices

Utility classes

  1. When writing a string of multiple utility classes, always do so in an order with meaning. The "Concentric CSS" approach works well with utility classes (i.e,. 1. positioning/visibility 2. box model 3. borders 4. backgrounds 5. typography 6. other visual adjustments). Once you establish a familiar pattern of ordering, parsing through long strings of utility classes will become much, much faster so a little more effort up front goes a long way!

  2. Always use fewer utility classes when possible. For example, use mx-2 instead of ml-2 mr-2 and don't be afraid to use the simpler p-4 lg:pt-8 instead of the longer, more complicated pt-4 lg:pt-8 pr-4 pb-4 pl-4.

  3. Prefix all utility classes that will only apply at a certain breakpoint with that breakpoint's prefix. For example, use block lg:flex lg:flex-col lg:justify-center instead of block lg:flex flex-col justify-center to make it very clear that the flexbox utilities are only applicable at the

This file has been truncated, but you can view the full file.
2391 ##linux Channel website: https://freenode.linux.community | Pastebin: https://paste.linux.community | Need an op? Join ##linux-ops | CoC? ##linux-offtopic, please.
1931 #python Don't paste, use https://paste.pound-python.org/ | http://bit.ly/psf-coc | Tutorial: http://bit.ly/MCAhYx | New programmer? http://bit.ly/23X7emF | Specify 2.x or 3.x in your question | Find your local User Group: http://goo.gl/S1Zsq | #python-fr #python.de #python-es #python.tw #python-br #python-nl #python-ir #python.it #python-ro #python-india #python-hu #python-dk #python-dev
1926 #freenode Welcome to #freenode | Feel free to message staff at any time. You can find us using /stats p (shows immediately-available staff) or /who freenode/staff/* (shows all staff) | See https://freenode.net/news/spambot-attack regarding spam | User mode +R blocks unregistered user PMs
1787 #python PSF Survey: https://bit.ly/psf-survey-2018 | Anything about Python is on-topic. Don't paste, use https://paste.pound-python.org/ | Be nice: https://j.mp
We can't make this file beautiful and searchable because it's too large.
name,l0,l1,l2,gender
"A Min Tjoa",GreaterAfrican,Africans,NULL,-
"A. A. Clark",GreaterEuropean,British,NULL,-
"A. Alfonso",GreaterEuropean,WestEuropean,French,-
"A. Ali",GreaterAfrican,Muslim,NULL,-
"A. Ant Ozok",Asian,GreaterEastAsian,Japanese,-
"A. Ardeshir Goshtasby",GreaterEuropean,British,NULL,-
"A. Basu",Asian,IndianSubContinent,NULL,-
"A. Beliz Saybasili",GreaterAfrican,Muslim,NULL,-
"A. Berger",GreaterEuropean,Jewish,NULL,-
title: First post!
type: post
This is my first post.
#[macro_use] extern crate macrolisp;
use macrolisp::prelude::*;
lisp! {
(ns
(extern [bytes futures
tokio_io
tokio_proto
tokio_service])
(use [(std {io str})
@naturallymitchell
naturallymitchell / b2sum.patch
Created September 5, 2015 07:02
Attempt to include BLAKE2 hash function to uutils/coreutils
diff --git a/src/hashsum/hashsum.rs b/src/hashsum/hashsum.rs
index a47aa1c..aea3f92 100644
--- a/src/hashsum/hashsum.rs
+++ b/src/hashsum/hashsum.rs
@@ -20,6 +20,7 @@ use crypto::digest::Digest;
use crypto::md5::Md5;
use crypto::sha1::Sha1;
use crypto::sha2::{Sha224, Sha256, Sha384, Sha512};
+use crypto::blake2b::Blake2b;
use regex::Regex;
@naturallymitchell
naturallymitchell / theme_inheritance.diff
Created February 23, 2014 16:15
Add base theme inheritance to Pelican.
diff --git a/pelican/__init__.py b/pelican/__init__.py
index 4726055..235c55b 100644
--- a/pelican/__init__.py
+++ b/pelican/__init__.py
@@ -44,6 +44,7 @@ class Pelican(object):
self.path = settings['PATH']
self.theme = settings['THEME']
+ self.base_theme = settings['BASE_THEME']
self.output_path = settings['OUTPUT_PATH']