Skip to content

Instantly share code, notes, and snippets.

View mwylde's full-sized avatar

Micah Wylde mwylde

View GitHub Profile
@mwylde
mwylde / docker-compose.yml
Created November 8, 2023 18:01
Arroyo with docker compose
version: '3'
services:
arroyo:
image: ghcr.io/arroyosystems/arroyo-single:latest
ports:
- '8000:8000'
- '8001:8001'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/ping"]

Keybase proof

I hereby claim:

  • I am mwylde on github.
  • I am micahw (https://keybase.io/micahw) on keybase.
  • I have a public key whose fingerprint is C04B DB5C 0D58 5CE0 107A A16C D8E5 26D0 A6A5 26A5

To claim this, I am signing this object:

override def query(q: String) = {
import net.liftweb.json._
import net.liftweb.json.JsonDSL._
import net.liftweb.json.Serialization.{read, write}
implicit val formats = DefaultFormats
val futures = clients.map(_.query(q).map(hr => {
val list = (parse(hr.getContent.toString("UTF-8")) \ "results").children
list.map(_.extract[String])
}))
@mwylde
mwylde / emcc-2-ll.ll
Created September 7, 2013 20:09
emscripten bug
; ModuleID = '/tmp/tmpHJQFbe/pbtest.bc'
target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
target triple = "le32-unknown-nacl"
%struct.malloc_state = type { i32, i32, i32, i32, i8*, %struct.malloc_chunk*, %struct.malloc_chunk*, i32, i32, i32, [66 x %struct.malloc_chunk*], [32 x %struct.malloc_tree_chunk*], i32, i32, i32, i32, %struct.malloc_segment, i8*, i32 }
%struct.malloc_chunk = type { i32, i32, %struct.malloc_chunk*, %struct.malloc_chunk* }
%struct.malloc_tree_chunk = type { i32, i32, %struct.malloc_tree_chunk*, %struct.malloc_tree_chunk*, [2 x %struct.malloc_tree_chunk*], %struct.malloc_tree_chunk*, i32 }
%struct.malloc_segment = type { i8*, i32, %struct.malloc_segment*, i32 }
%struct.malloc_params = type { i32, i32, i32, i32, i32, i32 }
%struct.Tuple = type <{ i16, [0 x %struct.anon] }>
@mwylde
mwylde / window.rb
Created February 20, 2012 04:28
OS X window management in MacRuby
framework "Carbon"
framework "ApplicationServices"
framework "AppKit"
class Application
def self.active
info = NSWorkspace.sharedWorkspace.activeApplication
pid = info["NSApplicationProcessIdentifier"]
new pid
end
@mwylde
mwylde / splines.scala
Created January 21, 2012 20:53
Cardinal splines in Scala
class Point(val x: Double, val y : Double) {
}
object Point {
def apply(x : Double, y : Double) = new Point(x, y)
def unapply(p : Point) = Some((p.x, p.y))
}
object CardinalSpline {
import scalala.tensor.dense._
@mwylde
mwylde / unshred.rb
Created November 18, 2011 05:31
Instagram Unshredder Challenge
require 'RMagick'
# Reads the images specified by filename and returns an RMagick Image
# object
def read filename
Magick::Image.read(filename).first
end
# Splits the input image into n vertical strips each with width equal
# to the input size (default 32). Returns an array of RMagick images
@mwylde
mwylde / google_reader.css
Created November 3, 2011 03:24
Better Google Reader styles
#top-bar {
display: none;
}
#viewer-header, #lhn-add-subscription-section {
height: 40px;
}
#entries.list .entry .collapsed {
padding: 2px 0;
@mwylde
mwylde / hash.rb
Created July 12, 2011 07:39
Hash.new
# Oftentimes, we want to create lists of things that have something in
# common. For example we may have a list of objects, each with a
# name. We want to count how many times each name occurs. We could do
# so with a hash, like this:
h = {}
a.each{|o|
# make sure there's a value here
h[o.name] ||= 0
h[o.name] += 1