Skip to content

Instantly share code, notes, and snippets.

View hunterboerner's full-sized avatar

Theron Boerner hunterboerner

View GitHub Profile
@hunterboerner
hunterboerner / README.md
Created June 29, 2018 19:59 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

# A module that will turn functions annotated with `@async :true` into functions
# that return a function that does the original function. For async goodness.
defmodule Magic do
defmacro __using__(_env) do
quote do
Module.register_attribute(__MODULE__, :async_register, accumulate: true)
@on_definition Magic
@before_compile Magic
end
end
@hunterboerner
hunterboerner / rust_spawn_command.rs
Created April 5, 2015 15:16
Spawn a command in Rust with separate STDIO and then print it out to the main thread's STDOUT (or whatever buffer you want).
let process = Command::new("randomstrings").stdin(Stdio::piped()).stdout(Stdio::piped()).spawn().unwrap();
let mut thing = process.stdout.unwrap();
loop {
let something: &mut [u8] = &mut [0];
thing.read(something);
print!("{}", std::str::from_utf8(something).unwrap())
}

Keybase proof

I hereby claim:

  • I am hunterboerner on github.
  • I am hunterboerner (https://keybase.io/hunterboerner) on keybase.
  • I have a public key whose fingerprint is 377E ADDF AA02 8C50 9894 493F F6CF 0516 3084 2B81

To claim this, I am signing this object:

loop = fn ->
receive do
{:whatever} ->
# stuff
loop.()
end
end