Skip to content

Instantly share code, notes, and snippets.

View marcomorain's full-sized avatar

Marc O'Morain marcomorain

View GitHub Profile
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
@marcomorain
marcomorain / gist:1901289
Created February 24, 2012 14:36
Ruby crash
/Users/marc/.rvm/gems/ruby-1.9.2-p290/gems/logging-1.7.0/lib/logging/logger.rb:100: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]
-- control frame ----------
c:0020 p:0008 s:0068 b:0067 l:000056 d:000066 BLOCK /Users/marc/.rvm/gems/ruby-1.9.2-p290/gems/logging-1.7.0/lib/logging/logger.rb:100
c:0019 p:---- s:0062 b:0062 l:000061 d:000061 FINISH
c:0018 p:---- s:0060 b:0060 l:000059 d:000059 CFUNC :each
c:0017 p:0022 s:0057 b:0057 l:000056 d:000056 METHOD /Users/marc/.rvm/gems/ruby-1.9.2-p290/gems/logging-1.7.0/lib/logging/logger.rb:99
c:0016 p:0097 s:0053 b:0053 l:000052 d:000052 METHOD /Users/marc/.rvm/gems/ruby-1.9.2-p290/gems/logging-1.7.0/lib/logging/root_logger.rb:31
c:0015 p:---- s:0050 b:0050 l:000049 d:000049 FINISH
@marcomorain
marcomorain / gist:1949078
Created March 1, 2012 10:54
I broke the build
Tasks: TOP => spec
(See full trace by running task with --trace)
/home/ubuntu/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:476: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
-- control frame ----------
c:0024 p:0043 s:0090 b:0088 l:000079 d:000087 BLOCK /home/ubuntu/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:476
c:0023 p:---- s:0085 b:0085 l:000084 d:000084 FINISH
c:0022 p:---- s:0083 b:0083 l:000082 d:000082 CFUNC :map
c:0021 p:0028 s:0080 b:0080 l:000079 d:000079 METHOD /home/ubuntu/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:475
@marcomorain
marcomorain / string_set.c
Created April 13, 2012 14:51
A string set in C
// gcc -std=c99 -Wall -Werror string_set.c && ./a.out
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
struct string_set* string_set_create(void);
void string_set_destroy(struct string_set* set);
int string_set_cardinality(struct string_set* set);
int string_set_contains(struct string_set* set, const char* string);
void string_set_add(struct string_set* set, const char* string);
[INFO] (["remote.rb:39:in `call_remote'"]) 2012-05-04 14:52:26 UTC - /api/errors?api_key=21e95ce67fa37d073da446e45f4bdc2b8a562588&protocol_version=5&hash=90373f0cc8b97344a36167e604d98c07 - OK
[INFO] (["remote.rb:39:in `call_remote'"]) 2012-05-04 14:52:30 UTC - /api/errors?api_key=21e95ce67fa37d073da446e45f4bdc2b8a562588&protocol_version=5&hash=90373f0cc8b97344a36167e604d98c07 - OK
[INFO] (["remote.rb:39:in `call_remote'"]) 2012-05-04 14:53:46 UTC - /api/errors?api_key=21e95ce67fa37d073da446e45f4bdc2b8a562588&protocol_version=5&hash=90373f0cc8b97344a36167e604d98c07 - OK
[INFO] (["railtie.rb:14:in `block in <class:Railtie>'"]) 2012-05-04 14:54:03 UTC - Loading Exceptional 2.0.32 for 3.2.2
[INFO] (["remote.rb:39:in `call_remote'"]) 2012-05-04 14:54:17 UTC - /api/errors?api_key=21e95ce67fa37d073da446e45f4bdc2b8a562588&protocol_version=5&hash=32a6f09b6879405198ece975ea5fec37 - OK
[INFO] (["remote.rb:39:in `call_remote'"]) 2012-05-04 15:00:27 UTC - /api/errors?api_key=21e95ce67fa37d073da446e45f4bdc2b8a562588&protoc
class ApplicationController < ActionController::Base
unless Rails.application.config.consider_all_requests_local
rescue_from ActionController::RoutingError, :with => :render_404
rescue_from ActiveRecord::RecordNotFound, :with => :render_404
rescue_from ActionController::UnknownAction, :with => :render_404
rescue_from ActionController::UnknownController, :with => :render_404
rescue_from Exception, :with => :render_500
end
# Called from the bottom of config/routes.rb for all non-exiting routes
@marcomorain
marcomorain / gist:2627311
Created May 7, 2012 11:20
Rendering Exceptional API to JavaScript using Ruby on Rails 3
<% if Exceptional::Config::should_send_to_api? %>
<%= javascript_include_tag '//exceptional-js.heroku.com/exceptional.js' %>
<script type="text/javascript">
Exceptional.setHost('exceptional-api.heroku.com');
Exceptional.setKey('<%= escape_javascript Exceptional::Config.api_key %>');
</script>
<% end %>
CSteamDoc::GenerateSubscriptionData(CUtlMap<unsigned int, CSteamSubscription*, int, CDefLess<unsigned int>>&, CUtlMap<unsigned int, CSteamLicense*, int, CDefLess<unsigned int>> const&) const
@marcomorain
marcomorain / gist:3342127
Created August 13, 2012 15:55
Marc's GPU in Chrome
Graphics Feature Status
Canvas: Hardware accelerated
Compositing: Hardware accelerated
3D CSS: Hardware accelerated
CSS Animation: Accelerated
WebGL: Hardware accelerated
WebGL multisampling: Hardware accelerated
Flash 3D: Hardware accelerated
Flash Stage3D: Hardware accelerated
Version Information
@marcomorain
marcomorain / gist:4119620
Created November 20, 2012 17:55
MySQL Crash
121120 17:54:55 InnoDB: Assertion failure in thread 4507598848 in file row0sel.c line 2441
InnoDB: Failing assertion: buf + data_len <= original_buf + buf_len
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
17:54:55 UTC - mysqld got signal 6 ;