Skip to content

Instantly share code, notes, and snippets.

View redbeard's full-sized avatar

Tal Rotbart redbeard

View GitHub Profile

Keybase proof

I hereby claim:

  • I am redbeard on github.
  • I am rotbart (https://keybase.io/rotbart) on keybase.
  • I have a public key ASCNieU3ZSLgwiJCcmbLkRQ99rOhkOUzLuwKDG4CzP3Jpwo

To claim this, I am signing this object:

@redbeard
redbeard / gist:1631377
Created January 18, 2012 06:04
Snippet to show Wikipedia after reading the SOPA blackout message. You can use this as a bookmarklet for easy invocation. Call your representative to protest SOPA/PIPA!
javascript:$('#mw-sopaOverlay').hide();$('#content').show();$('#mw-head').show();$('#mw-panel').show();$('#footer').show();
@redbeard
redbeard / demonstrate_issue.sh
Created November 29, 2011 02:54
Demonstrates a potential bug in elasticsearch's 'store' and 'enabled' mapping options
#!/bin/bash
curl -XDELETE 'http://localhost:9200/documents/'
echo ""
curl -XPUT 'http://localhost:9200/documents' -d '
{
"mappings": {
"document" : {
"_source" : { "enabled" : true },
"properties" : {
@redbeard
redbeard / switch-github-remote.rb
Created November 28, 2011 06:11
Quick and dirty script to toggle git remotes between github git and https:// remote urls.
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
def error(err, exit_code = -1)
$stderr.puts err
exit exit_code
end
def usage_error(err, exit_code = -1)
@redbeard
redbeard / animate_bubbles.js
Created April 28, 2011 04:02
Quick snippet to animate the bubbles background
function background(url, x, y) {
return "url(" + url + ") " + x + "px " + y + "px repeat";
}
$('body').attr('style', "offset:0; " + $('body').attr('style'));
$('body').animate({
offset: 100000,
},
{
@redbeard
redbeard / empty_matcher.py
Created January 19, 2011 04:11
should_dsl be_empty matcher.
# Simple should_dsl be_empty matcher by Tal Rotbart <redbeard at gmail dot com>
# {} |should| be_empty
# { 'has': 'contents' } |should_not| be_empty
from should_dsl import matcher
@matcher
class Empty(object):
name = 'be_empty'
def __call__(self):
repositories.remote << 'http://repo1.maven.org/maven2'
define 'my-search' do
project.version = '0.1.0'
compile.with transitive('org.apache.lucene:lucene-core:jar:3.0.1')
package :jar
end