Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Van Gheem vangheem

View GitHub Profile
@pfreixes
pfreixes / test_python.py
Created Jan 26, 2018
Testing how slow or fast is fetch attributes and call external functions
View test_python.py
from timeit import timeit
class Object:
def __init__(self, x):
self.x = x
class Rule:
def __init__(self, valid_values, valid_values2):
self.valid_values = valid_values
self.valid_values2 = valid_values2
@nicowilliams
nicowilliams / fork-is-evil-vfork-is-good-afork-would-be-better.md
Last active Nov 11, 2021
fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid
View fork-is-evil-vfork-is-good-afork-would-be-better.md

I recently happened upon an implementation of popen() (different API, same idea) using clone(2), and so I opened an issue requesting use of vfork(2) or posix_spawn() for portability. It turns out that on Linux there's an important advantage to using clone(2). I think I should capture the things I wrote there in a better place. A gist, a blog, whatever.

So here goes.

Long ago, I, like many Unix fans, thought that fork(2) and the fork-exec process spawning model were the greatest thing, and the Windows sucked for only having [exec*()](http://pubs.opengroup.org/onlinepubs/9699919

View ssl on lvh.me
I am the owner of lvh.me. And I'm glad to hear it's helpful. In truth, it's just a fancy DNS trick. lhv.me and all of it's sub-domains just point back to your computer (127.0.0.1). That means running ssl is as simple (or difficult) as running ssl on your computer.
I'm not sure how comfortable you are with the command line, but here's my how I setup my development environment. (rvm, passenger, nginx w/ SSL, etc).
# Install rvm (no sudo!)
# ------------------------------------------------------
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
source ~/.rvm/scripts/rvm
rvm install ree-1.8.7-2010.02