Skip to content

Instantly share code, notes, and snippets.

View guenter's full-sized avatar

Tobi Knaup guenter

View GitHub Profile
@guenter
guenter / using-twitter-commons-sample.sh
Created March 1, 2013 23:07
Using Twitter Commons sample app
# Clone the repo:
$ git clone git://github.com/airbnb/twitter-commons-sample.git
# Build using Maven:
$ mvn package
# Run:
$ bash run_local.bash
# Like a place:
package airbnb.cascading.sessions;
import cascading.flow.Flow;
import cascading.flow.FlowConnector;
import cascading.flow.hadoop.HadoopFlowConnector;
import cascading.pipe.Pipe;
import cascading.scheme.hadoop.TextLine;
import cascading.tap.SinkMode;
import cascading.tap.Tap;
import cascading.tap.hadoop.Hfs;
@guenter
guenter / gist:1424333
Created December 2, 2011 18:39
Lucene Facets Drill Down
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.facet.index.CategoryDocumentBuilder;
import org.apache.lucene.facet.index.params.DefaultFacetIndexingParams;
import org.apache.lucene.facet.index.params.FacetIndexingParams;
import org.apache.lucene.facet.search.DrillDown;
import org.apache.lucene.facet.search.FacetsCollector;
import org.apache.lucene.facet.search.params.CountFacetRequest;
import org.apache.lucene.facet.search.params.FacetRequest;
import org.apache.lucene.facet.search.params.FacetSearchParams;
@guenter
guenter / move_to_rds.rb
Created November 11, 2010 02:14
A quick and dirty script to move a database into Amazon RDS (or any other database). Can transfer part of the data beforehand.
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'
@guenter
guenter / mysql_commands_i_always_forget.sql
Created September 1, 2010 15:58
MySQL commands I forget all the time
-- Reset the query cache
RESET QUERY CACHE;
-- Closes all open tables, forces all tables in use to be closed, and flushes the query cache.
FLUSH TABLES;
-- Show character set in use by client, server, etc.
SHOW VARIABLES LIKE 'character_set%';
@guenter
guenter / api.feature
Created June 24, 2010 17:55
Snippets for testing REST APIs with Cucumber and friends
Feature: API
In order to use the service from third party apps
As a user
I want to be able to use an API
Background:
Given a user exists # Pickle
And I login as the user using basic auth
Scenario Outline: Get a ticket