Skip to content

Instantly share code, notes, and snippets.

View greatseth's full-sized avatar

Seth Thomas Rasmussen greatseth

View GitHub Profile
# This never seems to be hit..
module HTTParty
def self.perform_request(*args)
Rails.logger.info "HTTParty REQUEST: #{args.inspect}"
super
end
end
# I tried a simple method def which called super,
# but Ruby said 'no superclass method' even after
Factory.define :division do |d|
d.name { Factory.next(:word) }
d.association :office
end
Factory.define :office do |o|
o.name { Factory.next(:word) }
end
Factory.define :assignment do |a|
# If we have 10.0, we just want 10,
# but let's keep 10.5 and such.
def simple_value(v)
((v - v.to_i) > 0) ? v : v.to_i
end
@greatseth
greatseth / gist:200836
Created October 3, 2009 20:04
Strange HTTP requests from Freenode
Strange Mongrel output caused by requests from Freenode to port 2000:
Sat Oct 03 01:21:16 -0400 2009: HTTP parse error, malformed request (85.190.0.3): #<Mongrel::HttpParserError: Invalid HTTP format, parsing fails.>
Sat Oct 03 01:21:16 -0400 2009: REQUEST DATA: "\005\001\000"
---
PARAMS: {}
---
Sat Oct 03 01:21:22 -0400 2009: HTTP parse error, malformed request (85.190.0.3): #<Mongrel::HttpParserError: Invalid HTTP format, parsing fails.>
Sat Oct 03 01:21:22 -0400 2009: REQUEST DATA: "\004\001y??\\b\a\000"
---
/mnt/src/ffmpeg/trunk# ./configure --enable-gpl --enable-postproc --enable-libvorbis --enable-libtheora --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-pthreads --enable-libx264 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-nonfree --prefix=/mnt/bundle/ffmpeg --extra-ldflags="-L/mnt/bundle/lib -static" --extra-cflags="-I/mnt/bundle/include" --disable-ffserver
ERROR: libfaac not found
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.
/mnt/src/ffmpeg/trunk# ls /mnt/bundle/lib/
gpac libfaad.la libtheoradec.so libvorbisenc.so
/mnt/src/ffmpeg/trunk# ls /mnt/bundle/lib/
gpac libFLAC.la libopencore-amrwb.a libtheora.la
liba52.a libFLAC++.la libopencore-amrwb.la libtheora.so
liba52.la libFLAC.so libopencore-amrwb.so libtheora.so.0
libdca.a libFLAC++.so libopencore-amrwb.so.0 libtheora.so.0.3.4
libdca.la libFLAC++.so.6 libopencore-amrwb.so.0.0.2 libvorbis.a
libdca.so libFLAC++.so.6.2.0 libspeex.a libvorbisenc.a
libdca.so.0 libFLAC.so.8 libspeex.la libvorbisenc.la
libdca.so.0.0.0 libFLAC.so.8.2.0 libspeex.so libvorbisenc.so
libdts.a libgpac-0.4.5.so libspeex.so.1 libvorbisenc.so.2
ldd /mnt/bundle/ffmpeg/bin/ffmpeg
linux-gate.so.1 => (0x007f3000)
libz.so.1 => /usr/lib/libz.so.1 (0x007dc000)
libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x00426000)
libm.so.6 => /lib/tls/i686/nosegneg/libm.so.6 (0x004f1000) libfaac.so.0 => /usr/lib/libfaac.so.0 (0x00110000)
libfaad.so.2 => not found
libmp3lame.so.0 => /usr/lib/libmp3lame.so.0 (0x0093d000)
libopencore-amrnb.so.0 => /usr/local/lib/libopencore-amrnb.so.0 (0x00649000)
libopencore-amrwb.so.0 => /usr/local/lib/libopencore-amrwb.so.0 (0x00384000)
libtheora.so.0 => /usr/lib/libtheora.so.0 (0x00436000)
#!/usr/local/bin/ruby
a = "hello"
b = a.upcase
puts "a: #{a}"
puts "b: #{b}"
a.upcase!
#!/usr/bin/env shoes
Shoes.setup do
gem 'arrayfields'
end
require 'sqlite3'
APP_NAME = "Customer IP Address List"
class ChangeUseFileCacheDefaults < ActiveRecord::Migration
def self.up
change_column_default :jobs, :use_file_cache, :null => false, :default => false
end
def self.down
change_column_default :jobs, :use_file_cache
end
end