Skip to content

Instantly share code, notes, and snippets.

View ecmendenhall's full-sized avatar

Connor Mendenhall ecmendenhall

View GitHub Profile
@ecmendenhall
ecmendenhall / keybase.md
Created March 19, 2014 20:05
keybase.md

Keybase proof

I hereby claim:

  • I am ecmendenhall on github.
  • I am ecm (https://keybase.io/ecm) on keybase.
  • I have a public key whose fingerprint is 2931 AB89 F800 1F61 6455 008C 2D7F 74E9 C1B8 F6DB

To claim this, I am signing this object:

(menu-bar-mode -1)
(setq visible-bell nil)
(setq ring-bell-function 'ignore)
(disable-theme 'zenburn)
(require 'monokai-theme)
(enable-theme 'monokai)
(require 'evil)
(evil-mode 1)
@ecmendenhall
ecmendenhall / unicornleap.md
Last active August 29, 2015 14:03
Unicornleap from a Vagrant VM (OS X)

Unicornleap from Vagrant (OS X)

The vagrant-notify plugin replaces the Linux notify-send command in your Vagrant VM with a Ruby script that forwards notifcations to the host machine. You can use it to invoke unicornleap when your specs pass. (Or, you know, whenever).

On the host

From the host machine, install vagrant-notify:

$ vagrant plugin install vagrant-notify
# Some simple Ruby transducers
# Based on Rich Hickey's "Transducers" talk at Strangeloop 2014
# https://www.youtube.com/watch?v=6mTbuzafcII
# Clojure:
# (defn mapping [f]
# (fn [step]
# (fn [r x] (step r (f x)))))
def mapping(&procedure)
require_relative '0_parent_child'
require 'rspec'
describe ParentClass do
it 'creates a child class' do
expect(described_class.new.create_child_class).to be_a(ChildClass)
end
end
@ecmendenhall
ecmendenhall / all_emoji
Created January 27, 2015 05:04
all_emoji
:smile: :smiley: :grinning: :blush: :relaxed: :wink: :heart_eyes:
:kissing_heart: :kissing_closed_eyes: :kissing: :kissing_smiling_eyes:
:stuck_out_tongue_winking_eye: :stuck_out_tongue_closed_eyes:
:stuck_out_tongue: :flushed: :grin: :pensive: :relieved: :unamused:
:disappointed: :persevere: :cry: :joy: :sob: :sleepy: :disappointed_relieved:
:cold_sweat: :sweat_smile: :sweat: :weary: :tired_face: :fearful: :scream:
:angry: :rage: :triumph: :confounded: :laughing: :yum: :mask: :sunglasses:
:sleeping: :dizzy_face: :astonished: :worried: :frowning: :anguished:
:smiling_imp: :imp: :open_mouth: :grimacing: :neutral_face: :confused:
:hushed: :no_mouth: :innocent: :smirk: :expressionless: :man_with_gua_pi_mao:
class SpaceJam
def index(item)
if item.is_a?(Hash)
key = item['name']
items[key] = item
increment_name(key)
if item['children']
item['children'].each do |child|
index(child)
@ecmendenhall
ecmendenhall / unidiomatic.py
Last active December 12, 2015 07:08
Help! My Python is turning into Lisp!
def free(exp):
return set(walkreduce(lambda x: isinstance(x, unicode),
walkfilter(lambda x: (x not in bound(exp) and
x != 'lambda'),
exp)))
@ecmendenhall
ecmendenhall / pi_montecarlo.py
Created February 28, 2013 04:46
A Monte Carlo simulation that estimates pi. Just like on Wikipedia! http://en.wikipedia.org/wiki/Monte_carlo_method
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
def new_figure():
figure = plt.figure(122, figsize=(10.0, 5.0))
figure.add_subplot(121)
plt.axis('equal')