Skip to content

Instantly share code, notes, and snippets.

@mudge
mudge / gist:124170
Created June 5, 2009 09:34
Add vim Ruby syntax highlighting to .prawn files.
au BufNewFile,BufRead *.prawn set filetype=ruby
@wbzyl
wbzyl / percolated-twitter.rb
Created January 11, 2012 21:09 — forked from karmi/percolated-twitter.rb
Reversed or “Real Time” Search in ElasticSearch
# Reversed or “Real Time” Search in ElasticSearch
# ====================================================================================
# You may have come across the term “realtime search” lately
# (eg. [here](http://engineering.socialcast.com/2011/05/realtime-search-solr-vs-elasticsearch/))
# and wondered what all the fuss is about.
#
# Well, the usual workflow with search engines goes like this:
#
# 1. You index some documents.
@drewjoh
drewjoh / custom.js
Created January 27, 2012 13:55
Dynamic (AJAX) loaded Bootstrap Modal (Bootstrap 2.1)
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (url.indexOf('#') == 0) {
$(url).modal('open');
} else {