Skip to content

Instantly share code, notes, and snippets.

View mharris717's full-sized avatar

Mike Harris mharris717

View GitHub Profile
@mharris717
mharris717 / stats.md
Last active January 28, 2016 15:35
Card Crawl Stats

Stats

@mharris717
mharris717 / body.md
Last active January 6, 2016 16:14
Simultaneous Kelly - Sims
@thickSLICING @PlusEVAnalytics 1/2 kelly, sim bets with win% = vig free odds, 
get end roll in 5th ptile, use that for simul kelly. thoughts?

ME TALK GOODER

  • I have projections for the fights on a UFC card.
  • I want to make bets on the fights where I have an edge, and I want to make them all at once before any fights start.
  • Using half kelly.
@mharris717
mharris717 / current.csv
Last active February 2, 2016 04:33
abc
name1 name2 pred1 pred2 pinny1 pinny2
Robbie Lawler Carlos Condit 0.6361 0.3639 -115 -115
Stipe Miocic Andrei Arlovski 0.4823 0.5177 -225 175
Lorenz Larkin Albert Tumenov 0.4472 0.5528 210 -270
Brian Ortega Diego Brandao 0.5817 0.4183 -200 160
Tony Sims Abel Trujillo 0.5087 0.4913 -160 130
Drew Dober Scott Holtzman 0.3578 0.6422 150 -190
Masanori Kanehara Michael McDonald 0.2823 0.7177 400 -600
Sheldon Westcott Edgar Garcia 0.3467 0.6533 -160 130
Joe Soto Michinori Tanaka 0.2914 0.7086 105 -135
@mharris717
mharris717 / ufc.rb
Created October 28, 2015 00:24
UFC
require 'open-uri'
require 'mharris_ext'
require 'nokogiri'
doc = Nokogiri::HTML(open("fightnight.html"))
def fighter_name(node)
node.text.gsub("WIN","").gsub("**","").strip
end
@mharris717
mharris717 / home_chance.rb
Last active August 29, 2015 14:25
Home Chance
# the home team's win chance for a normal team not at a neutral field
def home_chance_normal(sim_context,away_team_arg,home_team_arg)
# away team dvoa, minus 5% if it's the divisional round
away = sim_context.dvoa(away_team_arg) - home_extra_bonus.to_f
# home team dvoa, capped at 40%
home = [0.40,sim_context.dvoa(home_team_arg)].min
# min_max(-0.35..0.35) restricts the value to between -35% and 35%
# abs_exp(2) squares it and returns the absolute value
1153 Sure Gamble (Core Set)
1086 Hedge Fund (Core Set)
963 Jackson Howard (Opening Moves)
625 Corroder (Core Set)
593 Same Old Thing (Creation and Control)
586 Clone Chip (Creation and Control)
560 R&D Interface (Future Proof)
533 Diesel (Core Set)
529 Plascrete Carapace (What Lies Ahead)
526 NAPD Contract (Double Time)
@mharris717
mharris717 / players.rb
Last active August 29, 2015 14:14
players.rb
require 'nokogiri'
require 'open-uri'
def players
list_of_players = []
f = File.open("PGpage.htm")
doc = Nokogiri::HTML(f)
rows = doc.css("tr.ranking_row a text(), tr.ranking_alt_row")
@mharris717
mharris717 / scrape.rb
Created January 16, 2015 18:28
scrape.rb
require 'open-uri'
require 'nokogiri'
def links
res = []
doc = Nokogiri::HTML(open("http://www.perfectgame.org/Rankings/Players/Default.aspx?gyear=2015&num=500"))
doc.css("tr.ranking_row, tr.ranking_alt_row").each do |row|
row.css("td:eq(4) a").each do |link|
res << link.attr('href')
@mharris717
mharris717 / Highlights.md
Last active August 29, 2015 14:10
Ember NYC Lightning Talk

2.5 Addons and a Call for Help.

Ember CLI Pagination

Pagination Addon for Ember CLI.

Great documentation and test coverage.

Supports multiple types of pagination

import Ember from 'ember';
export default Ember.Mixin.create({
changeOrder: function() {
this.get('model').setOtherParam('order',this.get('order'));
}.observes('order')
});