Skip to content

Instantly share code, notes, and snippets.

@anewusername1
anewusername1 / array_sorts.rb
Created February 24, 2011 15:18
Array sorting
class Array
def natural_sort
just_letters = self.select{|el| el =~ /^[a-zA-Z]+$/}
numbers = self - just_letters
just_letters.sort + numbers.sort{|x,y| x.gsub(/[a-zA-Z]+/, '').to_i <=> y.gsub(/[a-zA-Z]+/, '').to_i}
end
end
@anewusername1
anewusername1 / gist:837894
Created February 21, 2011 23:15
Justin Shakespear's nifty translation tool for twitter
javascript:(function(){var%20d=document;var%20s=d.createElement('script');s.text="KOBJ_config={'a877x1:kynetx_app_version':'dev','rids':['a877x1']};";d.body.appendChild(s);var%20l=d.createElement('script');l.src='http://init.kobj.net/js/shared/kobj-static.js';d.body.appendChild(l);})()
@anewusername1
anewusername1 / gist:567271
Created September 6, 2010 17:09
It's a start on making a select box thing much like jquery.multselect
(function($) {
$.widget("ui.singleselect", {
options: {
// sortable: true,
// searchable: true,
animated: 'fast',
show: 'slideDown',
hide: 'slideUp'
},