Skip to content

Instantly share code, notes, and snippets.

View rebeccaskinner's full-sized avatar

Rebecca Skinner rebeccaskinner

View GitHub Profile
package main
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"strings"
"time"
)
@rebeccaskinner
rebeccaskinner / gist:d7268f23b7c848365f91
Created August 7, 2014 19:45
Field-separated value parser
module DynamicNetworkGraph
class NetworkFlow
Fields = [:srcAddr,:dstAddr,:srcPort,:dstPort,:protocol,:start,:end,:packets,:transferred,:status]
attr_accessor :srcAddr
attr_accessor :dstAddr
attr_accessor :srcPort
attr_accessor :dstPort
attr_accessor :protocol
attr_accessor :start
attr_accessor :end
#!/usr/bin/ruby
# Create a simple function to call a lambda
def testCall f
f.call 3
end
# Call testCall with a lambda, this version works
testCall(lambda do |x| puts "test, x = #{x}" end)