This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
module Import | |
class F24 | |
def self.get_xml_doc | |
print "File Name > " | |
fname = gets.strip | |
pn = "#{::Rails.root.to_s}/db/match_data/#{fname}.xml" | |
puts "Path and File Name: #{pn}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateOptaEvents < ActiveRecord::Migration | |
def change | |
create_table :opta_events, :id => false do |t| | |
t.column :opta_game_id, :integer, :null => false | |
t.column :id, :integer, :primary => true | |
t.column :event_id, :integer | |
t.column :type_id, :integer | |
t.column :period_id, :integer | |
t.column :timeline, :integer | |
t.column :min, :integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................<3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Retreives and timestamps various XML feeds for later use | |
cd /Users/danielpage/Documents/BetCharts/ | |
curl http://lines.bookmaker.eu/ > bookmaker-$(date +%Y-%m-%d-%H.%M.%S).xml | |
curl http://xmlfeed.intertops.com/XMLOddsFeed/IntertopsOdds.aspx > intertops-$(date +%Y-%m-%d-%H.%M.%S).xml | |
curl http://xml.betclick.com/odds_en.xml > betclick-$(date +%Y-%m-%d-%H.%M.%S).xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
require 'net/http' | |
require 'cgi' | |
require 'fileutils' | |
require "date" | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am dannypage on github. | |
* I am dannypage (https://keybase.io/dannypage) on keybase. | |
* I have a public key whose fingerprint is 6507 FFBB EDDC 57B9 093C 9A64 3B40 998C E000 81BF | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Simple Twitter backup script | |
export DAY=`date +'%Y-%m-%d'` | |
echo "Backing up tweets..." | |
t timeline @jphpsf --csv --number 3000 > tweets-$DAY.csv | |
echo "Backing up retweets..." | |
t retweets --csv --number 3000 > retweets-$DAY.csv | |
echo "Backing up favorites..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
def generate_game(team_1_shots, team_2_shots) | |
score1 = (team_1_shots.map { |x| if rand < x then 1 else 0 end }).inject(:+) | |
score2 = (team_2_shots.map { |x| if rand < x then 1 else 0 end }).inject(:+) | |
return [score1,score2] | |
end | |
def evaluate(game) | |
if game[0] > game[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
require 'csv' | |
require 'diffy' | |
def clean_up(year, transaction) | |
transaction = transaction.gsub!(/IN:/,'') || transaction | |
transaction = transaction.gsub!(/OUT:/,'') || transaction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<h2>SC WCA Pixel</h2> | |
<p>Thanks for your help!</p> | |
<script>(function() { | |
var _fbq = window._fbq || (window._fbq = []); | |
if (!_fbq.loaded) { | |
var fbds = document.createElement('script'); | |
fbds.async = true; | |
fbds.src = '//connect.facebook.net/en_US/fbds.js'; |
OlderNewer