Skip to content

Instantly share code, notes, and snippets.

View gist:6055789
package io.tesla.issues.jira;
import java.nio.charset.Charset;
import retrofit.RequestInterceptor;
import retrofit.RestAdapter;
public class JiraService {
curl -XDELETE 'localhost:9200/test-idx'
curl -XPUT 'localhost:9200/test-idx' -d '{
"mappings": {
"doc": {
"properties": {
"foo" : {
"type": "string",
"index": "not_analyzed"
View gist:2492118
class ActionDispatch::Routing::Mapper
def draw(routes_name)
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
nono / redis2txt.rb
Created November 28, 2011 23:29
Export data from redis to a plain text files
View redis2txt.rb
#!/usr/bin/env ruby
require "redis"
redis =
redis.keys("*").each do |key|
val = case redis.type(key)
when "string"
redis.get key
when "list"
bdunagan / s3-delete-bucket.rb
Created November 21, 2011 17:23
s3-delete-bucket.rb: quickly delete large AWS S3 buckets using fog
View s3-delete-bucket.rb
#!/usr/bin/env ruby
# s3-delete-bucket.rb
# Fog-based script for deleting large Amazon AWS S3 buckets (~100 files/second)
# Forked from this excellent script:
require 'rubygems'
require 'thread'
require 'fog'
paulirish / data-markdown.user.js
Last active January 11, 2023 15:34
*[data-markdown] - use markdown, sometimes, in your HTML
View data-markdown.user.js
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <>
// @link
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
innotekservices / jquery.spin.js
Created October 16, 2011 02:39
jQuery Plugin for Spin.js
View jquery.spin.js
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
acreeger / gist:1027916
Created June 15, 2011 19:42
ElasticSearch: query_string vs text queries
View gist:1027916
curl -XDELETE http://localhost:9200/ac-test
curl -XPUT http://localhost:9200/ac-test
curl -XPUT http://localhost:9200/ac-test/people/1 -d '
"firstNames" : "James Earl",
"lastName" : "Jones",
"location" : "Hollywood, CA"
curl -XPUT http://localhost:9200/ac-test/people/2 -d '
lfborjas /
Created April 28, 2011 02:40
Tunnel a local port to a remote host (like does)
#usage python <local_port>
Taken from: (found in )
Let's say you have a webapp running in localhost (with ` runserver` in django or `ruby script.rb` in sinatra or `rails server` or whatever) and you want others to be able to see it with a public url without deploying remotely.
ssh provides a neat facility for that: tunneling. You set up a "tunnel" from the remote host to yours and vice-versa and then you give the remote host's url and it will send all of its requests to your local daemon.
superchink / show
Created April 20, 2011 22:42 — forked from tekacs/show
This does something essentially equivalent to if you have a publicly facing server...
View show
# Usage: show <local-port> <subdomain>
function show() {
ssh -tR 8080:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80: localhost"