Skip to content

Instantly share code, notes, and snippets.

@scottjg
scottjg / libgit2-clara-plaintext.patch
Created May 5, 2012 20:06
text version of my fix for libgit2 compilation on mingw32
--- clar.c.orig 2012-05-05 02:01:43 -0700
+++ clar.c 2012-05-05 02:10:45 -0700
@@ -29,7 +29,6 @@
# define strncpy(to, from, to_size) strncpy_s(to, to_size, from, _TRUNCATE)
# define W_OK 02
# define S_ISDIR(x) ((x & _S_IFDIR) != 0)
-# define mktemp_s(path, len) _mktemp_s(path, len)
# endif
typedef struct _stat STAT_T;
#else
refs/remotes/origin/no-fork-edit -> 4fd7b83793df4ce2ffa555c4afa48ca9af4c7030 [in refs/remotes/origin/master] (2 commits)
refs/remotes/origin/scroll-to-hook-config -> f118dff78442f7a19fbb3751479b800be3e74198 [in refs/remotes/origin/master] (0 commits)
refs/remotes/origin/hd-logo -> e6ae31e15d843cca22e1820ebe81fb37a7aca654 [in refs/remotes/origin/master] (1 commits)
refs/remotes/origin/fix-pr-leak-rick-spike -> 37d3cdae06b4acddbb4e01e3ac1b1165507897e0 [in refs/remotes/origin/master] (7 commits)
refs/remotes/origin/fix-profile-star-count -> 1e60e717b9895b3c7d16b4f9b9063f98093ec0f1 [in refs/remotes/origin/master] (1 commits)
refs/remotes/origin/rails3 -> 38d99095dfa7e0a01f71b2674c31e911889501be [in refs/remotes/origin/master] (61 commits)
refs/remotes/origin/smoke-upgrade -> 7282b82c13e1b3fce6bf5f3ad8f707403d290772 [in refs/remotes/origin/master] (1 commits)
refs/remotes/origin/gitauth_for_sshd -> 9d2608b04d85b2fd92bf9470fbdfbb8df8c6f413 [in refs/remotes/origin/master] (0 commits)
refs/remotes/origin/mentos-lexer
refs/remotes/origin/no-fork-edit -> 4fd7b83793df4ce2ffa555c4afa48ca9af4c7030 [in refs/remotes/origin/master] (2 commits)
refs/remotes/origin/scroll-to-hook-config -> f118dff78442f7a19fbb3751479b800be3e74198 [in refs/remotes/origin/master] (0 commits)
refs/remotes/origin/hd-logo -> e6ae31e15d843cca22e1820ebe81fb37a7aca654 [in refs/remotes/origin/master] (1 commits)
refs/remotes/origin/fix-pr-leak-rick-spike -> 37d3cdae06b4acddbb4e01e3ac1b1165507897e0 [in refs/remotes/origin/master] (7 commits)
refs/remotes/origin/fix-profile-star-count -> 1e60e717b9895b3c7d16b4f9b9063f98093ec0f1 [in refs/remotes/origin/master] (1 commits)
refs/remotes/origin/rails3 -> 38d99095dfa7e0a01f71b2674c31e911889501be [in refs/remotes/origin/master] (61 commits)
refs/remotes/origin/smoke-upgrade -> 7282b82c13e1b3fce6bf5f3ad8f707403d290772 [in refs/remotes/origin/master] (1 commits)
refs/remotes/origin/gitauth_for_sshd -> 9d2608b04d85b2fd92bf9470fbdfbb8df8c6f413 [in refs/remotes/origin/master] (0 commits)
refs/remotes/origin/mentos-lexer
@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
#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
A < B < C < D (master)
^
E < F < G (feature branch)
A < B < C < D < E (master)
^ ^
F < G < H < I (feature
@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
@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 / 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);