Skip to content

Instantly share code, notes, and snippets.

View avescodes's full-sized avatar

Avery Quinn avescodes

View GitHub Profile

Keybase proof

I hereby claim:

  • I am rkneufeld on github.
  • I am rkneufeld (https://keybase.io/rkneufeld) on keybase.
  • I have a public key whose fingerprint is 1A4A 094D D64C FFC8 A8E7 F71F C510 F110 AB0B 89B5

To claim this, I am signing this object:

(require '[datomic.api :as d]
'[clojure.stacktrace :as st])
;; Knobs
(def datoms-per-tx 1000)
;; Monitoring
(def start-time (atom 0))
(def transaction-count (atom 0))

Keybase proof

I hereby claim:

  • I am rkneufeld on github.
  • I am rkneufeld (https://keybase.io/rkneufeld) on keybase.
  • I have a public key whose fingerprint is 7714 DC1D EF61 4C70 1DF8 5387 B75F AF61 E0C0 89C6

To claim this, I am signing this object:

@avescodes
avescodes / acquirer.clj
Last active August 29, 2015 14:22
Conveying Information with Simulant’s Process State Service
(ns my-suite.actions.acquirer
(:require ;; …
[io.homegrown.sim-ephemeral :as eph])
(defn create-payment
Create a payment, returning a vector of [<response> <payment id> <nsecs taken>]”
[action]
…)
(defn approve-paymenet
@avescodes
avescodes / gist:14199
Created October 1, 2008 21:37
Simple logic parser I did for an assignment
#Here I add a two helper methods to the Fixnum class to aid in creating cases
class Fixnum
#returns T/F (actually F/T) if number is zero.
def bool
self.zero?
end
#Create a number of cases based on the calling number
#i.e. 2 returns [ [T,T], [T,F], [F,T], [F,F]]
def create_cases
def do_work
fltArray = [-361, -359, -44, -0.001, 0.0001, 1, 45, 89,
90, 91, 179, 180, 189, 360, 360001 ]
cosVals = []
sinVals = []
tempVar = -1.0
for (int i = 0; i < fltArray.length, i++)
{
if(fltArray[i] >= 360.0)
{
<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.73 [en] (Windows NT 5.0; U) [Netscape]">
<meta name="Author" content="Web Creations - John Shotton - jasit@mts.net - (204) 882-2832">
<meta name="Description" content=" R. M. of Stanley, Gardenland of Manitoba.">
<meta name="KeyWords" content="rm of stanley, rural, municipality, of, stanley, Morden, Manitoba, MB, Canada, City of Winkler, Manitoba, Best in Country Living, Corn and Apple Festival, Minnewasta, south central, Winnipeg, Lake Minnewasta, Pembina Hills Art Gallery, Leo Mol statue, Canadian Fossil Discovery Centre, fossils, Morden Museum, Back Forty Folk Festival, Morden International Triathlon, Colert Beach, Agriculture Canada Research Station, Minnewasta Golf and Country Club, Manitoba Baseball Hall of Fame, Pembina Thresherman's Museum, Cripple Creek Music Festival, Morden Mighty Man Competition, Thresherman's Reunion, Bound
require 'benchmark'
str = "1 2 3 4-5 6 7 8-9"
Benchmark.bm do |bm|
bm.report("split: ") {10000.times do hash = Hash.new(0); str.split.each { |m| hash[m] += 1}; end }
bm.report("scan: (\\w+) ") { 10000.times do hash = Hash.new(0); str.scan(/\w+/m) { |m| hash[m] += 1} end }
bm.report("scan: (\w+(-\w+)?) ") { 10000.times do hash = Hash.new(0); str.scan(/(\w+(-\w+)?)/m) { |m| hash[m] += 1} end }
end
## Native environment tests - 1.8.7
(defn count-atoms [L]
(cond
(not (coll? L)) 1
(empty? L) 0
(list? L) (apply + (map count-atoms L))))
@avescodes
avescodes / git-update.rb
Created January 12, 2009 01:53
Quick little git repo editor
#!/opt/local/bin/ruby -w
require 'YAML'
# Example ~/.git_repos :
# repos:
# - "~/dev/gh/joust"
# - "~/dev/gh/joust/meta"
config = YAML.load_file(ENV['HOME'] + "/.git_repos")
config['repos'].each do |f|
f.gsub!('~',ENV['HOME'])