Skip to content

Instantly share code, notes, and snippets.

View estsauver's full-sized avatar

Earl St Sauver estsauver

View GitHub Profile
(ns blog.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]))
(enable-console-print!)
(def post1 {:title "Learn Clojurescript from Scratch"
@estsauver
estsauver / method_finder.rb
Last active December 20, 2015 17:29
Finding classes that respond to some method.
#inovke using rails r /path/to/method_finder.rb
Rails.application.eager_load!
classes = ActiveRecord::Base.descendants
company_id = []
company = []
classes.each do |c|
begin
c.new.company_id
company_id.push(c.name)
rescue Exception => msg
@estsauver
estsauver / Reply.markdown
Last active December 20, 2015 03:39
Email to President Monaco

Hi Earl,

President Monaco brought to my attention your question regarding email account expiration. This is good timing, as Tufts Technology Services, in partnership with the Schools, is currently discussing the merits of maintaining a tufts.edu email address beyond graduation for some of the reasons you mention.

Like many institutions, Tufts currently provides email forwarding for life through Alumni Relations. Graduates can register for an “@alumni.tufts.edu” account that provides an enduring email address that won't change over time (http://www.alumniconnections.com/olc/pub/TUF/permemail.html). This approach is in place based on earlier feedback and experience that suggests many individuals do not wish to manage a separate university email account after graduation, particularly as they acquire additional personal and work-related accounts.

While many find the email forwarding service to be valuable for managing Tufts’ contacts throughout one’s career, it does not address the issue you raise regarding

@estsauver
estsauver / modeler.py
Created April 22, 2013 06:46
Just in case, here's the program.
__author__ = 'estsauver'
from pybrain.tools.shortcuts import buildNetwork
from pybrain.datasets import SupervisedDataSet
from pybrain.supervised.trainers import BackpropTrainer
from scipy.spatial import cKDTree
import scipy
from math import fabs
from sensorCalibration import sensorPins
class MyController < UIViewController
def viewDidLoad
super
top_view.addSubview chart_view([[0,0], [100,100],
[10, 20, 20, 15, 35],
["#203a65", "#37537c", "#5b7faa", "#aec2d6", "#aec2d6", "#ffffff"]
)
end
def chart_view(frame, data, colors)
@estsauver
estsauver / sillygame.rb
Created March 18, 2013 17:19
Silly Game simulator
require 'active_support/core_ext/enumerable.rb'
def game
playing = true
board = (1..12).to_a
while playing do
diceroll = [Random.rand(6)+1, Random.rand(6)+1]
play = earlStrategy(board, diceroll) || []
playing = checkPlay(play,board,diceroll)
# puts "Board was #{board}"
# puts "Roll was #{diceroll}"
@estsauver
estsauver / whoisScript.rb
Last active December 14, 2015 15:49
Whois script for getting university names from domains
require 'whois'
def getUniversitys(domainNameArray)
#DomainNameArray should be in the form host.edu/host.com/host.whatever.
# i.e. tufts.edu, harvard.edu, etc., not http://tufts.edu
w = Whois::Client.new
domainNameArray.each do |domain|
r = w.query(domain)
puts r.registrant_contact[:organization]