Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
index 40cc169..9ceed14 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -29,6 +29,7 @@ endif
check_PROGRAMS = \
test_start_stop \
test_get \
+ test_quiesce \
test_get_sendfile \
diff --git a/configure.ac b/configure.ac
index ad3b102..071d985 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,7 +132,7 @@ netbsd*)
;;
*linux*)
AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
- AC_DEFINE_UNQUOTED(HAVE_LISTEN_SHUTDOWN,1,[can use shutdown on listen sockets])
+ #AC_DEFINE_UNQUOTED(HAVE_LISTEN_SHUTDOWN,1,[can use shutdown on listen sockets])
#!/usr/bin/env ruby
require 'date'
require 'pp'
after = DateTime.parse(ARGV[0])
before = DateTime.parse(ARGV[1])
puts after
puts before
@scottjg
scottjg / gist:4647558
Created January 27, 2013 09:35
patch in charlock holmes to avoid using magic files
diff --git a/ext/charlock_holmes/encoding_detector.c b/ext/charlock_holmes/encoding_d
index 537e4a3..2c52e17 100644
--- a/ext/charlock_holmes/encoding_detector.c
+++ b/ext/charlock_holmes/encoding_detector.c
@@ -274,7 +274,7 @@ static VALUE rb_encdec__alloc(VALUE klass)
rb_raise(rb_eStandardError, "%s", u_errorName(status));
}
- detector->magic = magic_open(0);
+ detector->magic = magic_open(MAGIC_NO_CHECK_SOFT);
@scottjg
scottjg / heap_compactor_ext.c
Created January 13, 2013 00:12
Forces Ruby GC to compact the tcmalloc heap after garbage collecting
#include <ruby.h>
#include <stdlib.h>
#include <stdio.h>
#include <node.h>
#include <dlfcn.h>
void (*ReleaseFreeMemory)(void);
#ifdef RUBY_GC_EVENT_ALL
// requires https://github.com/tmm1/brew2deb/blob/master/packages/ruby/patches/gc-hooks.patch
@scottjg
scottjg / broken.rb
Created December 18, 2012 00:58
broken module class mix-in
#!/usr/bin/env ruby
module My
module Foo
class Bar
def hello
puts "hello"
end
end
end
A < B < C < D < E (master)
^ ^
F < G < H < I (feature
A < B < C < D (master)
^
E < F < G (feature branch)
#include <stdio.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define STATS_IN_PORT 8126
#define STATS_OUT_IP "127.0.0.1"
#define STATS_OUT_PORT 18126
@scottjg
scottjg / metricsd profiling data
Created October 8, 2012 09:02
metricsd profiling data
Statistical profiling result from v8.log, (84214 ticks, 0 unaccounted, 0 excluded).
[Shared libraries]:
ticks total nonlib name
25525 30.3% 0.0% /usr/bin/node
2849 3.4% 0.0% /lib/libpthread-2.7.so
2743 3.3% 0.0% /lib/libc-2.7.so
74 0.1% 0.0% /usr/lib/libstdc++.so.6.0.10
58 0.1% 0.0% ffffffffff600000-ffffffffff601000
2 0.0% 0.0% 7fff74725000-7fff74726000