Skip to content

Instantly share code, notes, and snippets.

@wallace
wallace / gist:5371897
Created April 12, 2013 13:12
failure building ruby 2.0 on my mac book pro
[2013-04-12 09:11:05] make
CC = /usr/local/bin/gcc-4.2
LD = ld
LDSHARED = /usr/local/bin/gcc-4.2 -dynamiclib
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration -fno-common -pipe
XCFLAGS = -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/libxslt/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I. -I.ext/include/x86_64-darwin12.3.0 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,sup
@wallace
wallace / error
Last active December 14, 2015 10:29
Override a Rails attr_accessor method with a method that expects an argument and watch it fail.
temp.rb:19:in `title': wrong number of arguments (0 for 1) (ArgumentError)
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activemodel-3.2.12/lib/active_model/dirty.rb:143:in `attribute_change'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activemodel-3.2.12/lib/active_model/dirty.rb:117:in `block in changes'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activemodel-3.2.12/lib/active_model/dirty.rb:117:in `map'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activemodel-3.2.12/lib/active_model/dirty.rb:117:in `changes'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/attribute_methods/dirty.rb:34:in `block in save!'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/attribute_methods/dirty.rb:33:in `tap'
from /Users/jonathanwallace/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.12/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
from /Users/jonathanw
@wallace
wallace / urlgrab.conf
Created February 14, 2013 01:27
Example urlgrab.conf configuration for weechat.
#
# urlgrab.conf -- weechat v0.3.9.2
#
[color]
color_bg_selected = green
color_buffer = red
color_buffer_selected = red
color_time = cyan
color_time_selected = cyan
@wallace
wallace / irc.conf
Created February 14, 2013 01:19
An example server section from my weechat irc.conf configuration file, ~/.weechat/irc.conf. /help server will give you the commands to setup an IRC server.
[server]
freenode.addresses = "chat.freenode.net/6667"
freenode.proxy
freenode.ipv6
freenode.ssl
freenode.ssl_cert
freenode.ssl_priorities
freenode.ssl_dhkey_size
freenode.ssl_verify
freenode.password
@wallace
wallace / debugger session
Last active December 12, 2015 02:08
Example of saving debugger session using https://github.com/cldwalker/debugger.
(rdb:1) help save
save [FILE]
Saves current debugger state to FILE as a script file.
This includes breakpoints, catchpoints, display expressions and some settings.
If no filename is given, we will fabricate one.
Use the 'source' command in another debug session to restore them.
(rdb:1) help source
source FILE executes a file containing debugger commands
(rdb:1)
@wallace
wallace / app.js
Created October 11, 2012 14:43
Grabbed from the socket.io examples
var app = require('http').createServer(handler)
, io = require('socket.io').listen(app)
, fs = require('fs')
app.listen(80);
function handler (req, res) {
fs.readFile(__dirname + '/index.html',
function (err, data) {
if (err) {
class LineItem < ActiveRecord::Base
belongs_to :product
belongs_to :order
validates :price, :quantity, numericality: true
validates :product_id, :order_id, presence: true
end
class Order < ActiveRecord::Base
has_many :line_items
validates :total_price, numericality: true
before_create :apply_returning_customer_discount, if: lambda { |order| order.returning_customer? }
def apply_returning_customer_discount
self.total_price = self.total_price * 0.9
end
class Product < ActiveRecord::Base
validates :price, numericality: true
end
~ 1.9.3-p194 $ cd Documents/projects/activeadmin-xlsx/
~/Documents/projects/activeadmin-xlsx (wip) 1.9.3-p194 $ be rake
/Users/jonathanwallace/.rbenv/versions/1.9.3-p194/bin/ruby -S rspec ./spec/lib/active_admin/xlsx/settings_spec.rb
ActiveAdmin requires meta_search >= 1.1.0.pre and sass-rails ~> 3.1.0.rc to work with rails >= 3.1.0
Mocha deprecation warning: Test::Unit or MiniTest must be loaded *before* Mocha.
Mocha deprecation warning: If you're integrating with another test library, you should probably require 'mocha_standalone' instead of 'mocha'
F
Failures: