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
#!/bin/bash | |
# This script cleans up your EC2 instance before baking a new AMI. | |
# Run the following command in a root shell: | |
# | |
# bash <(curl -s https://gist.github.com/justindowning/5921369/raw/ami-clean.sh) | |
function print_green { | |
echo -e "\e[32m${1}\e[0m" | |
} |
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
class A | |
def foo(num) | |
%w[one two three][num - 1] | |
end | |
end | |
describe A do | |
describe "#foo" do | |
RSpec::Matchers.define :do_foo do |args| | |
match do |instance| |
/* language */ | |
apply { | |
plugin 'groovy' | |
plugin 'java' | |
} | |
/* ide */ | |
apply { | |
plugin 'idea' | |
plugin 'eclipse' |
def root = new File("./src/") | |
println root.absolutePath | |
lastmodified = [:] | |
current = [:] | |
while(true){ | |
current.clear() | |
root.eachFileRecurse { | |
current << ["${it.absolutePath}":it.lastModified()] | |
} | |
if(!current.equals(lastmodified)){ |
namespace :rails_best_practices do | |
desc "run rails best practices" | |
task :jenkins_plot_plugin => :environment do | |
cd Rails.root do | |
OUTDIR = "#{Rails.root}/reports" | |
mkdir OUTDIR unless FileTest.exist? OUTDIR | |
OUTFILE = "#{OUTDIR}/rails_best_practices.properties" |
import com.sun.net.httpserver.HttpExchange | |
import com.sun.net.httpserver.HttpHandler | |
import com.sun.net.httpserver.HttpServer | |
import groovy.xml.MarkupBuilder | |
def PORT = 6001 | |
HttpServer server = HttpServer.create(new InetSocketAddress(PORT), 0); | |
server.createContext("/", new HttpHandler() { | |
@Override | |
public void handle(HttpExchange he) throws IOException { |
#! /usr/bin/env ruby | |
require 'pdf-reader' # gem install pdf-reader --prerelease | |
puts PDF::Reader.new(ARGV.first).page_count |
--- coffee-mode.el 2011-09-08 14:52:36.000000000 +0900 | |
+++ my-coffee-mode.el 2011-09-08 14:54:21.000000000 +0900 | |
@@ -99,6 +99,12 @@ | |
:type 'string | |
:group 'coffee) | |
+(defcustom js2coffee-command "js2coffee" | |
+ "The js2coffee command used for evaluating code. Must be in your | |
+path." |