Skip to content

Instantly share code, notes, and snippets.


Nicholas Bennett lovingawareness

  • Strata Decision Technology
  • Chicago, IL
View GitHub Profile
lovingawareness / circles.tex
Last active November 30, 2019 06:49
Using LaTeX to make circles on an equilateral triangle grid. Seed of Life Coloring Book.
View circles.tex
% Given that A4 paper is 21cm x 29.7 cm, we can calculate the maximum number of circles that will fit on the page based on the radius
lovingawareness /
Created November 1, 2019 16:51
Making silly phrases out of initials
from random import choice
from functools import reduce
with open('mobypos.txt', 'r', encoding='latin1') as f:
moby_words = [line.strip() for line in f.readlines()]
words = [dict(zip(['word', 'pos'], moby_word.split('\\'))) for moby_word in moby_words]
pos_key = {
'Noun': 'N',
lovingawareness / r-rstudio-tinytex-faq.markdown
Last active January 8, 2019 19:15
FAQs related to installing R, RStudio, TinyTeX at Kellogg
View r-rstudio-tinytex-faq.markdown

FAQs for Installing R, RStudio, and TinyTeX

@ Kellogg School of Management

1. /usr/local/bin not writable

I see this error when I install TinyTeX:

add_link_dir_dir: destination /usr/local/bin not writable, no links from /Users/hagen/Library/TinyTeX/bin/x86_64-darwin. add of symlinks had 1 error(s), see messages above. add of symlinks had 1 error(s), see messages above. tlmgr: An error has occurred. See above messages. Exiting.

This is an issue on some Macs, where that folder /usr/local/bin is not writable by your user account for some reason. Here's how to fix it:

lovingawareness / beer_menu.thor
Created January 27, 2018 04:59 — forked from cadwallion/beer_menu.thor
Ruck beer list scraper
View beer_menu.thor
#!/usr/bin/env ruby
# A Thor-based commandline tool for all BeerMenu.
# Based on @jsteiner's Ruby equivalent of @jlet's Python Ruck
# beer list scraper
# @jsteiner's Original:
# @jlet's Original: ttps://
require 'open-uri'
require 'nokogiri'
lovingawareness /
Created January 27, 2018 04:58 — forked from jletourneau/
Ruck beer list scraper
from pyquery import PyQuery as pq
import re
import datetime
doc = pq(url='')
lovingawareness /
Last active January 9, 2018 19:31 — forked from roselleebarle04/
Simple django fabric script for deployment
import os
import sys
from fab_deploy import *
from fabric.contrib.console import confirm
from fabric.api import env, cd, prefix, local, sudo as _sudo, run as _run, hide, task, settings, abort
from fabric.contrib.files import exists, upload_template
from fabric.colors import yellow, green, blue, red
from fabric.operations import _prefix_commands, _prefix_env_vars
from contextlib import contextmanager
lovingawareness / gist:92e7950a27b2b96b52830fa54c09e9c8
Created November 28, 2017 01:24 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:92e7950a27b2b96b52830fa54c09e9c8


:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
lovingawareness /
Last active May 16, 2017 18:47 — forked from paulgb/
Convert the Yelp Academic dataset from JSON to CSV files with Pandas.
Convert Yelp Academic Dataset from JSON to CSV
Requires Pandas (
By Paul Butler, No Rights Reserved
import json
import pandas as pd
from __future__ import print_function
from pprint import pprint
# Write a function done_or_not passing a board (list[list_lines]) as parameter.
# If the board is valid return 'Finished!', otherwise return 'Try again!'
# Sudoku rules:
lovingawareness /
Last active September 14, 2015 02:52 — forked from 46bit/
Face detection using OpenCV. Refactored from
import sys, cv2
# Refactored
def cascade_detect(cascade, image):
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
return cascade.detectMultiScale(
scaleFactor = 1.15,
minNeighbors = 5,