Skip to content

Instantly share code, notes, and snippets.

View ktopping's full-sized avatar

Kieran Topping ktopping

  • Unbound, and self
  • Dublin, Ireland
View GitHub Profile
searchable do
text :xml, :boost => 2.0
end
common: &common
solr:
hostname: localhost
port: 8983
production:
<<: *common
development:
<<: *common
config.gem 'sunspot', :lib => 'sunspot'
config.gem 'sunspot_rails', :lib => 'sunspot/rails'
git-rm --cached log/development.log
public!
@ktopping
ktopping / gist:286058
Created January 25, 2010 17:44
A javascript function for turning a space (or punctuation) - delimited string into a camel case String.
// There's probably a more concise solution, but I prefer clarity over conciseness
// Splits on any number of non-word characters.
// Apostrophes don't cause case-change.
function toCamelCase(str) {
if (str==null || str==undefined || str.length==0) return str;
str = str.replace(/'/g, "");
var arr = str.split(/[^\w]+/g); // split on any sequence of one or more
// non-word chars.
var ret = "";
// Look for the first non-zero-length String.