This is how I debug SystemStackError when there is no stack trace.
My first attempt was:
begin
a_method_that_causes_infinite_recursion_in_a_not_obvious_way
rescue SystemStackError
puts caller
end
var DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
time_ago_in_words: function(from) { |
#!/usr/bin/env perl | |
# Via: http://erdani.org/code/scpi.html | |
################################################################################ | |
## Copyright (c) 2006 by Andrei Alexandrescu | |
## Permission to use, copy, modify, distribute and sell this software for any | |
## purpose is hereby granted without fee, provided that the above copyright | |
## notice appear in all copies and that both that copyright notice and this | |
## permission notice appear in supporting documentation. | |
## The author makes no representations about the |
#!/usr/bin/perl | |
# Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs | |
# License: See below. | |
# http://gist.github.com/507356 | |
use strict; | |
use warnings; | |
use URI::Escape; |
// Add Modernizr test for font-smoothing | |
// A designer may wish to darken the colour of a given font when antialiasing is applied | |
// Examples of font-smoothing in action: http://bit.ly/bLeUg1 | |
/* | |
Usage: | |
Add to your page | |
Use html.fontsmoothing h1 { color: xxx; } to make your colours darker | |
*/ |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
### Nginx upstart script | |
### source: http://serverfault.com/a/391737/70451 | |
### /etc/init/nginx.conf | |
description "nginx http daemon" | |
start on (filesystem and net-device-up IFACE=lo) | |
stop on runlevel [!2345] | |
env DAEMON=/usr/local/sbin/nginx |
require "rubygems" | |
require "twitter" | |
require "json" | |
# things you must configure | |
TWITTER_USER = "your_username" | |
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted | |
# get these from dev.twitter.com | |
CONSUMER_KEY = "your_consumer_key" |
# Weighted Moving Average (WMA) | |
# http://en.wikipedia.org/wiki/Moving_average#Weighted_moving_average | |
# | |
# Given a hash, calculates the weighted moving averages of its values within | |
# a window size given. Modifies the original hash values. | |
# | |
# @param hash [Hash] the hash for whom values calculate the weighted moving | |
# averages. | |
# @param maws [Fixnum] the Moving Average Window Size. The greatest this | |
# number is the smoothest the calculated averages will be. |
This is how I debug SystemStackError when there is no stack trace.
My first attempt was:
begin
a_method_that_causes_infinite_recursion_in_a_not_obvious_way
rescue SystemStackError
puts caller
end