Skip to content

Instantly share code, notes, and snippets.

View thbar's full-sized avatar

Thibaut Barrère thbar

View GitHub Profile
# not sure if it's the simpliest way, yet it works
# I'm using this to test ramaze application
require 'rubygems'
require 'spec'
require 'webrat'
Webrat.configure do |config|
config.mode = :mechanize
end
# works (ie: raise the error) using "[ruby|ir] top-level-methods.rb". Raise "missing log method" under silverlight.
def log(msg)
raise msg
end
class TestClass
def initialize
log("hello using top-level method")
end
From 9313f5fb34d7e998cd90f49279977f0417ab2a5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thibaut=20Barr=C3=A8re?= <[email protected]>
Date: Wed, 2 Sep 2009 13:38:10 +0200
Subject: [PATCH] Required patch for Ramaze
---
.../lib/thinking_sphinx/configuration.rb | 2 ++
gems/thinking-sphinx/lib/thinking_sphinx/tasks.rb | 15 ++++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
@thbar
thbar / search-dash-thinking-sphinx.yml
Created September 13, 2009 17:37
Configuration tweaking to allow search words with dash in there in ThinkingSphinx
defaults: &defaults
# charset_table tweak to allow searching words that include dash (-) in thinking sphinx
# this is the default charset but with dash (-) added to ensure it's not considered to be a delimited
charset_table: "-, 0..9, A..Z->a..z, _, a..z, \
U+410..U+42F->U+430..U+44F, U+430..U+44F"
production:
....
<<: *defaults
development:
....
# load the Rails configuration (to use migrations, kcode, various extensions)
# to be called from .ebf or .ctl file
require File.dirname(__FILE__) + '/../../config/environment'
# then later on, you can reference your model classes in the etl
require 'C:\Program Files\Open XML Format SDK\V2.0\\lib\DocumentFormat.OpenXml.dll'
include DocumentFormat::OpenXml::Packaging
include DocumentFormat::OpenXml::Spreadsheet
doc = SpreadsheetDocument.open('docs/single-cell.xlsx', false)
a = doc.workbook_part.workbook.method(:get_first_child).of(Sheets).call
puts a
# -> DocumentFormat.OpenXml.Spreadsheet.Sheets
# what I used to fix my Lexmark X4650 driver issue
# (use at your own risk)
sudo rm -rf /Library/Printers/Lexmark/
sudo rm -rf /System/Library/Extensions/LexmarkUSBMerge.kext
# then software update to retrieve the latest drivers
layout do |path, wish|
if (path !~ /feed/ && path !~ /show/)
mobile_rendering? ? :mobile : :main
else
nil
end
end
private
This is a quick roadmap for learnivore mobile (http://m.learnivore.com)
Done - as a Mobile User:
1 - I want to be able to see the 20 latest screencasts on http://m.learnivore.com [DONE]
2 - I need to be able to achieve full-text search [DONE]
Planned - as a Mobile User:
3 - I want a screencast detail page so that I can read the summary
4 - I want to be able to choose between (all or free or paid) content
5 - I'd like a one-click way to go straight to the iphone video
unsupported signal SIGQUIT
./gems/resque-1.3.1/lib/resque/worker.rb:225:in `trap'
./gems/resque-1.3.1/lib/resque/worker.rb:225:in `register_signal_handlers'
./gems/resque-1.3.1/lib/resque/worker.rb:202:in `startup'
./gems/resque-1.3.1/lib/resque/worker.rb:108:in `work'
./gems/resque-1.3.1/lib/resque/tasks.rb:24
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'