Public Gists by thbar

Gravatar
Sun Nov 22 07:40:45 -0800 2009
1
2
3
# what I used to fix my Lexmark X4650 driver issue
# (use at your own risk)
 
Gravatar
Fri Nov 20 07:11:13 -0800 2009
1
2
3
require 'C:\Program Files\Open XML Format SDK\V2.0\\lib\DocumentFormat.OpenXml.dll'
 
include DocumentFormat::OpenXml::Packaging
Gravatar
Wed Nov 04 06:55:12 -0800 2009
1
2
3
# load the Rails configuration (to use migrations, kcode, various extensions)
# to be called from .ebf or .ctl file
require File.dirname(__FILE__) + '/../../config/environment'
gist: 186253 Configuration tweaking to a...
Gravatar
Sun Sep 13 10:37:22 -0700 2009
1
2
3
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
Gravatar
Wed Sep 02 04:39:49 -0700 2009
1
2
3
From 9313f5fb34d7e998cd90f49279977f0417ab2a5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thibaut=20Barr=C3=A8re?= <thibaut.barrere@gmail.com>
Date: Wed, 2 Sep 2009 13:38:10 +0200
Gravatar
Wed Aug 26 00:12:14 -0700 2009
1
2
3
# works (ie: raise the error) using "[ruby|ir] top-level-methods.rb". Raise "missing log method" under silverlight.
 
def log(msg)
Gravatar
Wed Jul 29 17:08:19 -0700 2009
1
2
3
# not sure if it's the simpliest way, yet it works
# I'm using this to test ramaze application
 
Gravatar
Mon Jun 22 01:03:22 -0700 2009
1
2
3
# patch to handle connection pooling outside of rails: http://www.williambharding.com/blog/rants/rails-22-connection-pools-mongrel-handlers-bloodbath/
# call ActiveRecord::Base.connection_handler.clear_connection! from your controller once you're done with ActiveRecord work
module ActiveRecord
Gravatar
Mon Jun 22 01:02:04 -0700 2009
1
2
3
module Ramaze
  module Helper
    module WillPaginateForRamaze
gist: 81663 Windows Forms C# sugar
Gravatar
Thu Mar 19 02:09:45 -0700 2009
1
2
3
public static void InWorkerThread(this Control control, Action action) {
  BackgroundWorker worker = new BackgroundWorker();
  worker.DoWork += (sender, e) => action();
Gravatar
Thu Mar 19 01:45:19 -0700 2009
1
2
3
/* the helper, built as a Control extension method */
 
public delegate void Action();
Gravatar
Sat Feb 07 10:12:41 -0800 2009
1
2
3
<VirtualHost <%= public_ip %>:80>
  ServerName <%= server_name %>
  
Gravatar
Sat Feb 07 07:47:53 -0800 2009
1
2
3
When calling rake ts:index or rake ts:start, if the command is not successful, you'll get something like:
 
=======================================
Gravatar
Mon Feb 02 02:29:52 -0800 2009
1
2
3
preprocess {
  # mark the current data for deletion - do not delete right away
  # to avoid ending up with no data on the web-site
gist: 56865 TinyTL and ThinkingSphinx
Gravatar
Mon Feb 02 02:21:55 -0800 2009
1
2
3
preprocess {
  Item.delete_all
}
gist: 55108 better ts:index ?
Gravatar
Fri Jan 30 07:28:34 -0800 2009
1
2
3
Index: thinking-sphinx/tasks/thinking_sphinx_tasks.rb
===================================================================
--- thinking-sphinx/tasks/thinking_sphinx_tasks.rb (revision 809)
Gravatar
Thu Jan 29 02:16:49 -0800 2009
1
2
3
today = Date.today.strftime("%Y-%m-%d")
yesterday = (Date.today - 1).strftime("%Y-%m-%d")
 
Gravatar
Wed Jan 28 13:55:25 -0800 2009
1
2
3
#!/usr/local/bin/ruby
 
# inspired by http://ariejan.net/2009/01/04/how-to-start-a-rails-edge-app-the-easy-way/
Gravatar
Fri Jan 02 07:50:56 -0800 2009
1
2
3
Index: thinking-sphinx/lib/thinking_sphinx/attribute.rb
===================================================================
--- thinking-sphinx/lib/thinking_sphinx/attribute.rb (revision 809)
Gravatar
Mon Dec 29 08:41:16 -0800 2008
1
2
3
# patch to handle connection pooling outside of rails: http://www.williambharding.com/blog/rants/rails-22-connection-pools-mongrel-handlers-bloodbath/
module ActiveRecord
  module ConnectionAdapters