Skip to content

Instantly share code, notes, and snippets.

@sasha-id
sasha-id / README
Created March 23, 2012 15:03
MongoDB multiple instance upstart scripts: mongodb, mongod --configsvr and mongos
MongoDB upstart scripts for Ubuntu.
Run following commands after installing upstart scripts:
ln -s /lib/init/upstart-job /etc/init.d/mongoconf
ln -s /lib/init/upstart-job /etc/init.d/mongodb
ln -s /lib/init/upstart-job /etc/init.d/mongos
To start services use:
@mbostock
mbostock / .block
Last active January 26, 2022 14:32 — forked from mbostock/.block
Spline Transition
license: gpl-3.0
@fmela
fmela / agm_log.c
Created December 30, 2011 20:15
A natural logarithm function that uses the arithmetic-geometric mean.
double
agm_log(double x)
{
double a, b, e, e0 = DBL_MAX;
assert(x > 0.0);
for (a = (x + 1.0) * 0.5, b = sqrt(x); (e = fabs(a - b)) < e0; e0 = e) {
a = 0.5 * (a + b);
b = sqrt(a * b);
@fmela
fmela / stacktrace.cxx
Last active November 20, 2024 13:00
A C++ function that produces a stack backtrace with demangled function & method names.
/*
* Copyright (c) 2009-2017, Farooq Mela
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright