Skip to content

Instantly share code, notes, and snippets.

View emidln's full-sized avatar

Brandon Adams emidln

  • Chicago, IL
View GitHub Profile
@emidln
emidln / secret_santa.py
Created October 23, 2021 20:19
Takes a csv of people and phone numbers and sends out text messages for who they received in secret santa.
#!/usr/bin/env python3
import csv
import itertools
import os
import random
import sys
from twilio.rest import Client as TwilioClient
# we need to strip these off otherwise IntelliJ/CLion will defeat our customized .bazelrc configs
DEBUG_FLAG_LISTS = [
[ # Copied from clwb/src/com/google/idea/blaze/clwb/run/BlazeCidrRunConfigurationRunner.java
"--compilation_mode=dbg",
"--copt=-O0",
"--copt=-g",
"--strip=never",
"--dynamic_mode=off",
"--fission=yes"],
# BUg Doomsday tldr;
#### by @emidln
// 2020Q4 BUG Doomsday
4 Doomsday (DD)
2 Personal Tutor (PT)
1 Thassa's Oracle (TO)
1 Ideas Unbound (IU)
4 Brainstorm (BS)
4 Ponder (PDR)
3 Lotus Petal
4 Lion's Eye Diamond
1 Thassa's Oracle
1 Street Wraith
4 Dark Ritual
4 Thought Scour
4 Brainstorm
4 Force of Will
1 Predict
1 Ideas Unbound
(ns test-browser-project.core
(:require [clojure.test :refer [with-test testing is]]
[clojure.spec.alpha :as s]))
; Note: Can do this in python or any other language too!
; Browser history:
; Browser should support URL bar, forward and back buttons
; creates the history object - use a class, record, or other structure if you want!
(require '[clojure.spec.alpha :as s])
(require '[spec-tools.spec :as spec])
(require '[spec.settings :as ss])
;; declare your configuration
(def settings-config
{:debug {:spec spec/boolean?
:doc "When true, debug options are turned on."
:default false}
(ns spec.settings
"Organizes and validates your settings with clojure.spec and spec-tools."
(:require [clojure.string :as str]
[clojure.spec.alpha :as s]
[spec-tools.spec :as spec]
[spec-tools.core :as st]
[spec-tools.data-spec :as ds]))
(defmacro for-map
"Like for, but returns a map. Expects the result to be a pair or map."
@emidln
emidln / rpartial.clj
Last active July 13, 2018 15:24
rpartial.clj ((c) bja; licensed under EPL, the same as clojure)
(defmacro rpartial
"Takes a form leaving a new variadic function which calls the head of form
with the variadic arguments and then the arguments passed in as form. This
has the effect of being a partial which preloads arguments from the right
instead of the left.
e.g.
((rpartial str \"World\") \"Hello \")"
[& [f & xs]]
#!/bin/bash
if [[ $(amixer -D pulse get Master | grep -E "\[on\]") ]]; then
amixer -D pulse get Master | grep -Eo "[[:digit:]]{1,3}%" | tail -1
else
echo "Muted"
fi
set-option -g default-command "/usr/bin/bash -il"
# new prefix
unbind C-b
set -g prefix M-Space
# quick back
bind M-Space last-window
# vi-style keybindings
setw -g mode-keys vi
unbind [
bind Escape copy-mode