Skip to content

Instantly share code, notes, and snippets.

View edsrzf's full-sized avatar

Evan Shaw edsrzf

  • Vend
  • Auckland, New Zealand
View GitHub Profile
@edsrzf
edsrzf / gist:4759ee8e5e26d1b12330
Last active August 29, 2015 14:03
Benchmarking value vs. pointer receiver for a 56-byte struct
package main
import (
"encoding/binary"
"testing"
)
var little = binary.LittleEndian
type Segment struct {
@edsrzf
edsrzf / gist:9314832
Last active August 29, 2015 13:56
Fair serialization benchmarks
package main
import (
"bytes"
"encoding/gob"
"encoding/json"
"io"
"io/ioutil"
"math"
"testing"
@edsrzf
edsrzf / Log
Last active December 13, 2015 20:19
Steam/SpaceChem log
Running Steam on arch 64-bit
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(1360966495_client)
Installing breakpad exception handler for appid(steam)/version(1360966495_client)
unlinked 0 orphaned pipes
(steam:3119): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
/usr/share/themes/Adwaita/gtk-2.0/gtkrc:989: error: unexpected identifier `direction', expected character `}'
Installing breakpad exception handler for appid(steam)/version(1360966495_client)
[0217/132846:WARNING:proxy_service.cc(646)] PAC support disabled because there is no system implementation
curl -H "Authorization: OAuth TOKEN" -H "Content-Type: application/json" \
-d '{"push_type":"multicast", "subscribers": [{"url": "http://mysterious-brook-1807.herokuapp.com/ironmq_push_1"}, {"url": "http://mysterious-brook-1807.herokuapp.com/ironmq_push_2"}]}' \
"https://mq-aws-us-east-1.iron.io/1/projects/PROJECT_ID/queues/pushq-demo-1"
@edsrzf
edsrzf / readfq.closure.go
Created October 13, 2012 20:08
read fastq go
package main
import (
"bufio"
"bytes"
"compress/bzip2"
"compress/gzip"
"flag"
"fmt"
"io"
@edsrzf
edsrzf / batching_queue.rb
Created June 13, 2012 02:40 — forked from treeder/batching_queue.rb
Example of queuing up 100 workloads per task
users = User.all
users.each_slice(100) do |users_slice|
puts "Queueing worker..."
worker = NotificationWorker.new
worker.users = users_slice
# set other attributes that your worker needs to run
worker.queue
end
From ac5cfa9da4c66efecc2864f96ae0c6e9fa677c01 Mon Sep 17 00:00:00 2001
From: Evan Shaw <edsrzf@gmail.com>
Date: Sat, 10 Mar 2012 10:18:11 +1300
Subject: [PATCH] Only first selected actor speaks on command
Previously all selected actors would speak when given a command, which
made for a noisy experience. Now only the first selected actor speaks.
Don't call CommandActor on TryToAttack.
From 4b9cbf6653ae06944d4ab469f362ba6711bbba67 Mon Sep 17 00:00:00 2001
From: Evan Shaw <edsrzf@gmail.com>
Date: Fri, 9 Mar 2012 13:12:15 +1300
Subject: [PATCH] Fix segfault for games with no monk class
When an unarmed character attacked, the engine tried to apply monk bonuses
even when no monk class was available, causing a segfault.
---
gemrb/core/Scriptable/Actor.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From 1fd11bc7e404fa8d0766c855aaa37123114dafe3 Mon Sep 17 00:00:00 2001
From: Evan Shaw <edsrzf@gmail.com>
Date: Fri, 9 Mar 2012 10:45:57 +1300
Subject: [PATCH] Fix select and command sound issues
* Correct the radio button values for CommandSounds and SelectionSounds in
all games.
* When Selection Sounds Frequency is Seldom, play sound 20% of the time
instead of 25% of the time to match the option description.
* When Command Sounds Frequency is Seldom, play a sound only once after
@edsrzf
edsrzf / bench.rb
Created February 3, 2012 02:10
Queue benchmark
require 'benchmark'
require 'aws'
require 'beanstalk-client'
require 'carrot'
require 'iron_mq'
require_relative 'config.rb'
msg = "a"*1000