Skip to content

Instantly share code, notes, and snippets.

@rweald
rweald / gist:1149468
Created August 16, 2011 16:22
Custom GVim config without peepopen
if has("gui_macvim")
" Fullscreen takes up entire screen
set fuoptions=maxhorz,maxvert
" Command-T for CommandT
macmenu &File.New\ Tab key=<D-T>
map <D-t> :CommandT<CR>
imap <D-t> <Esc>:CommandT<CR>
" Command-Return for fullscreen
require 'em-synchrony'
require 'em-synchrony/em-http'
require 'em-synchrony/em-jack'
require 'nokogiri'
module MendeleyScraper
class MasterScraper
# get all the necessary urls from the mendeley sitemap
# this opperation appear sync due to fibers
@rweald
rweald / jammit.rake
Created June 1, 2011 19:58
Using Barista with Jammit to package and compile CoffeeScript
# simply run rake jammit:package to compile your coffeescript and then package up all your assets
# including the newly compiled javascripts
namespace :jammit do
task :package do
Rake::Task["barista:brew"].invoke
Jammit.package!
end
end
@rweald
rweald / gist:969981
Created May 13, 2011 04:42
Multi-threaded Non blocking file uploads using EventMachine and EM-Http-Request
#!/usr/bin/env ruby
require 'em-http-request'
require 'fiber'
require "ruby-debug"
class AsynUploader
@successes = []
@failures = []
@rweald
rweald / simple_rspec_watchr.rb
Created March 29, 2011 18:15
This is a simple script that will run spec test suite for files in lib directory. Ideal for testing a gem
We couldn’t find that file to show.
@rweald
rweald / Thumbnail to Video
Created February 9, 2011 22:15
A simple script that replicates the Mac Finder UI that allows you to swap a thumbnail for a video when a play button is clicked.
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Test Page</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.thumbnail').bind("mouseenter", function(){
$(this).append('<img class="play_button" src="http://www.hamptonbid.com/17BullRun.com/play-button_png_1058132788.png" />');