Skip to content

Instantly share code, notes, and snippets.

View clemensg's full-sized avatar

Clemens Gruber clemensg

View GitHub Profile
@clemensg
clemensg / unicorn
Created January 26, 2012 20:08
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@clemensg
clemensg / unicorn
Created January 26, 2012 20:08
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@clemensg
clemensg / unicorn
Created January 26, 2012 20:08
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@clemensg
clemensg / macvim_drawer.rb
Created August 8, 2012 11:48 — forked from tubbo/macvim_drawer.rb
macvim-drawer homebrew formula
require 'formula'
class MacvimDrawer < Formula
homepage 'https://github.com/alloy/macvim'
head 'git://github.com/alloy/macvim.git', :branch => 'split-browser'
def options
[
# Building custom icons fails for many users, so off by default.
["--custom-icons", "Try to generate custom document icons."],
@clemensg
clemensg / keccak.rb
Created October 4, 2012 13:51
Minor changes to Christian Neukirchens Keccak implementation in pure Ruby
# To the extent possible under law, Christian Neukirchen has waived
# all copyright and related or neighboring rights to the source code
# in this file.
# http://creativecommons.org/publicdomain/zero/1.0/
#
# Minor changes by Clemens Gruber, 04.Oct. 2012:
# * Added time measurement to tests
# * Optimized rotl64 a little bit (roughly 30 percent faster),
# because rotl64 is the function which is called most often.
#
@clemensg
clemensg / curl_multi_test.c
Last active June 28, 2023 06:51
libcurl multi interface example
/* curl_multi_test.c
Clemens Gruber, 2013
<clemens.gruber@pqgruber.com>
Code description:
Requests 4 Web pages via the CURL multi interface
and checks if the HTTP status code is 200.
Update: Fixed! The check for !numfds was the problem.
@clemensg
clemensg / curl_libuv_example.c
Last active November 2, 2023 01:48
An example on how to use libuv with libcurl's multi interface Should be equally fast on Unixes (uses epoll/kqueue/etc like libev/libevent) but MUCH faster on Windows due to libuv's usage of IO completion ports. Could come in handy if you have to manage several hundreds or thousands of connections!
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>
#include <curl/curl.h>
uv_loop_t *loop;
CURLM *curl_handle;
uv_timer_t timeout;
typedef struct curl_context_s {
@clemensg
clemensg / homebrew_mavericks_fix.patch
Last active December 18, 2015 13:18
Fixes most of homebrew's problems on OSX 10.9 Mavericks (If /usr/include does not exist, treat it like a system with Xcode only)
From 3a37b93f95081f697f9d0941360af7fcee701099 Mon Sep 17 00:00:00 2001
From: Clemens Gruber <clemensgru@gmail.com>
Date: Sat, 15 Jun 2013 18:38:32 +0200
Subject: [PATCH] Fix Homebrew on OSX 10.9 Mavericks
---
Library/Homebrew/os/mac/xcode.rb | 2 +-
Library/Homebrew/superenv/macsystem.rb | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
@clemensg
clemensg / utf8_fix.diff
Last active December 18, 2015 18:18
Should fix a unicode bug in subversion (1.8.0) on Mac OSX. Caveat emptor!
--- subversion/libsvn_subr/path.c~ 2013-06-20 17:58:25.000000000 +0200
+++ subversion/libsvn_subr/path.c 2013-06-20 18:23:06.000000000 +0200
@@ -40,6 +40,9 @@
#include "dirent_uri.h"
+#if defined(DARWIN)
+#include <CoreFoundation/CoreFoundation.h>
+#endif /* DARWIN */
diff -daurp subversion-1.8.0/subversion/libsvn_subr/path.c subversion-1.8.0-newpatch/subversion/libsvn_subr/path.c
--- subversion-1.8.0/subversion/libsvn_subr/path.c 2013-05-14 00:40:07.000000000 +0200
+++ subversion-1.8.0-newpatch/subversion/libsvn_subr/path.c 2013-07-02 23:39:04.000000000 +0200
@@ -40,6 +40,10 @@
#include "dirent_uri.h"
+#ifdef DARWIN
+#include <CoreFoundation/CoreFoundation.h>
+#endif