Skip to content

Instantly share code, notes, and snippets.

# Samples: 57 of event 'cpu-clock:uhpppH'
# Event count (approx.): 14250000
#
# Overhead Command Shared Object Symbol
# ........ .............. .................... ......................................................................................................................................................................................................
#
7.02% (redacted) ld-2.26.so [.] do_lookup_x
7.02% (redacted) libnss_files-2.26.so [.] internal_getent
5.26% (redacted) libresolv-2.26.so [.] __res_context_send
5.26% (redacted) (redacted) [.] (redacted)
diff --git a/libguile/stime.c b/libguile/stime.c
index f430ca4..8b810a7 100644
--- a/libguile/stime.c
+++ b/libguile/stime.c
@@ -834,6 +834,10 @@ scm_init_stime()
#ifdef HAVE_POSIX_CPUTIME
{
+#ifdef __APPLE__
+ if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0)

Keybase proof

I hereby claim:

  • I am rahulg on github.
  • I am rahulg (https://keybase.io/rahulg) on keybase.
  • I have a public key ASDLgVek4iC5HG3gH9dHIu4KYfb5O8bdHYD6NMNT1eBwEQo

To claim this, I am signing this object:

@rahulg
rahulg / activate
Created June 25, 2013 14:30
Virtualenv-like activate & deactivate for golang. Source this file the normal way from bash to activate the GOPATH, deactivate to deactivate.
export GOPATH="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
export OLDPS1=$PS1
export PS1="[go:$(basename $GOPATH)] $PS1"
alias gcd="cd $GOPATH"
deactivate() {
export PS1=$OLDPS1
unset GOPATH
unset OLDPS1
unalias gcd
unset deactivate
def f():
l = []
def g(x):
l.append(x)
return l
return g
a = f()
b = f()
diff --git a/configure b/configure
index fdef550..7a7b2e4 100755
--- a/configure
+++ b/configure
@@ -1023,7 +1023,7 @@ then
if [ -n "$CFG_OSX_CLANG_VERSION" ]
then
case $CFG_OSX_CLANG_VERSION in
- (7.0* | 7.1* | 7.2* | 7.3*)
+ (7.0* | 7.1* | 7.2* | 7.3* | 8.0*)
@rahulg
rahulg / twitch-chat.py
Created June 6, 2016 08:47
Dump twitch chat replays
import datetime
import json
import re
import sys
import urllib.request
video_id = sys.argv[1]
try:
start_offset = int(sys.argv[1])
except (IndexError, ValueError):
@rahulg
rahulg / SetFont.java
Created July 12, 2013 15:53
Setting a custom typeface on Android.
TextView tv = (TextView) findViewById(R.id.someTextView);
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/fontname.otf");
tv.setTypeface(tf);
@rahulg
rahulg / goinit
Last active December 18, 2015 23:08
Initialise a golang project by setting up the directory structure and creating the virtualenv-like activate script.
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $(basename "${0}") <project>"
exit 1
fi
mkdir -p "${1}"/{,src,pkg,bin}
cat << 'EOF' > "${1}/activate"
@rahulg
rahulg / gist:5232531
Created March 24, 2013 16:23
~/.gitignore OS X-specific fragment
# OS X
.DS_Store
._*
.Spotlight-V100
Icon?
.Trashes