Skip to content

Instantly share code, notes, and snippets.

import java.util.*;
public class bfs {
public static void main(String[] args) {
// A hashmap is also called an "associative array." Think of it as an
// array, but instead of being indexed with numbers 0 to n-1, it is
// indexed based on the keys you supply. In this case, the hashmap has
// keys that are strings, and values that are arrays of strings.
HashMap<String, String[]> family = new HashMap<String, String[]>();
# frozen_string_literal: true
require "set"
require "minitest/autorun"
# Helper method for `get_levels`. Using a breadth-first search, traverse up the
# parent entries in the adjacency list, setting entries in the `levels` hashmap
# and adding relatives to the `level_known` set. Relies on Ruby's
# pass-by-reference semantics for objects to mutate arguments `levels` and
# `level_known` (which is the point of calling the function).
\documentclass[12pt]{article}
\title{Madigan Kent, LCSW\\Intake Paperwork}
\date{}
\author{}
\newcommand{\signatureblock}{
\begin{table}[!ht]
\begin{tabularx}{\textwidth}{XlX}
~ & ~ & ~ \\
@Ethan826
Ethan826 / .vimrc
Last active August 15, 2019 20:05
" Plug
call plug#begin('~/.vim/plugged')
Plug 'HerringtonDarkholme/yats.vim'
Plug 'NLKNguyen/papercolor-theme'
Plug 'Shougo/denite.nvim'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'airblade/vim-gitgutter'
Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh' }
Plug 'cespare/vim-toml'
@Ethan826
Ethan826 / election_odds.rb
Created November 4, 2016 18:41
Scrape poll aggregators for current odds
#!/usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
module OddsGetter
class OddsGetter
def initialize(url:, selector:, selector_type: :xpath, processing_func: ->(h) { h.text.to_f })
@url = url
@processing_func = processing_func
@selector = selector
class Odds
def initialize
@teams = {ari: 1998, atl: 1871, bal: 1901, bos: 1901, chc: 1874, cws: 1901,
cin: 1882, cle: 1901, col: 1993, det: 1901, fla: 1993, hou: 1962,
kan: 1969, laa: 1961, lad: 1884, mil: 1969, min: 1901, nym: 1962,
nyy: 1901, oak: 1901, phi: 1883, pit: 1882, sd: 1969, sea: 1977,
sf: 1883, stl: 1882, tb: 1998, tex: 1961, tor: 1977, was: 1969}
end
def tally_teams_given_year(year)
worker_processes 1;
#error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
#pid /var/run/nginx.pid;
events {

Keybase proof

I hereby claim:

  • I am ethan826 on github.
  • I am ethank (https://keybase.io/ethank) on keybase.
  • I have a public key whose fingerprint is AA2A 7DBF F5D5 5177 16C6 A394 B39D 4276 2685 6825

To claim this, I am signing this object:

/**
* Enums and interfaces
*/
enum Choices {
cooperate,
defect
}
interface Results {
@Ethan826
Ethan826 / cubs.clj
Last active February 26, 2016 16:25
Calculate the chances of the Cubs performance
(ns baseball.core
(:require [clojure.set :as s])
(:gen-class))
(def TEAMS
{:orioles 1901 :red-sox 1901 :yankees 1901 :rays 1998 :blue-jays 1977
:white-sox 1901 :indians 1901 :tigers 1901 :royals 1969 :twins 1901
:astros 1962 :angels 1961 :athletics 1901 :mariners 1977 :rangers 1961
:braves 1871 :marlins 1993 :mets 1962 :phillies 1883 :nationals 1969
:cubs 1874 :reds 1869 :brewers 1969 :pirates 1882 :cardinals 1882