Skip to content

Instantly share code, notes, and snippets.

View estsauver's full-sized avatar

Earl St Sauver estsauver

View GitHub Profile
@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]
@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}"
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 / 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
@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 / 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
(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"
/* See license.txt for terms of usage */ .firebugCanvas { position:fixed; top: 0; left: 0; display:none; border: 0 none; margin: 0; padding: 0; outline: 0; } .firebugCanvas:before, .firebugCanvas:after { content: ""; } .firebugHighlight { z-index: 2147483646; position: fixed; background-color: #3875d7; margin: 0; padding: 0; outline: 0; border: 0 none; } .firebugHighlight:before, .firebugHighlight:after { content: ""; } .firebugLayoutBoxParent { z-index: 2147483646; position: fixed; background-color: transparent; border-top: 0 none; border-right: 1px dashed #E00 !important; border-bottom: 1px dashed #E00 !important; border-left: 0 none; margin: 0; padding: 0; outline: 0; } .firebugRuler { position: absolute; margin: 0; padding: 0; outline: 0; border: 0 none; } .firebugRuler:before, .firebugRuler:after { content: ""; } .firebugRulerH { top: -15px; left: 0; width
@estsauver
estsauver / keybase.md
Created December 12, 2014 05:46
keybase.md

Keybase proof

I hereby claim:

  • I am estsauver on github.
  • I am estsauver (https://keybase.io/estsauver) on keybase.
  • I have a public key whose fingerprint is 3916 1459 3D61 A943 C2CB 2439 A36A 2675 02DD A09A

To claim this, I am signing this object:

enum ParseResult<T> {
Success(T),
Failure,
Error
}
impl <T> ParseResult<T> {
fn map<U, F: Fn(T) -> U>(&self, f: F) -> ParseResult<U> {
match *self {
ParseResult::Success(t) => ParseResult::Success(f(t)),