Skip to content

Instantly share code, notes, and snippets.

@rklaehn
rklaehn / AstClient.java
Created February 19, 2014 10:15
Benchmark for inserting wide rows into a Cassandra DB using both CQL and Thrift APIs
package cassandra;
import java.util.Iterator;
import com.netflix.astyanax.ColumnListMutation;
import com.netflix.astyanax.serializers.AsciiSerializer;
import com.netflix.astyanax.serializers.LongSerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@aq1018
aq1018 / example.sh
Created February 22, 2014 01:35
ElasticSearch Autocomplete example
curl -XDELETE 'http://localhost:9200/media'
curl -XPUT 'http://localhost:9200/media' -d'
{
"mappings": {
"movie": {
"properties": {
"genre": {
"type": "string",
"analyzer": "keyword"
#!/bin/bash
# To use:
# wget https://gist.githubusercontent.com/indapublic/11370314/raw/7cf3d956a02d90679988a1f1ca660104ec8e1fbc/amazon-install-redis.sh
# chmod 777 amazon-install-redis.sh
# ./amazon-install-redis.sh
###############################################
echo "*****************************************"
echo " 1. Prerequisites: Install updates, set time zones, install GCC and make"
echo "*****************************************"
#sudo yum -y update
import org.apache.spark._
import org.apache.spark.SparkContext._
import org.json4s.jackson.JsonMethods
import org.json4s.jackson.JsonMethods._
import org.json4s.JsonAST._
object UserInterestsExample {
def main(args: Array[String]): Unit = {
val sc = new SparkContext("local[8]", "UserInterestsExample")
@ueshin
ueshin / sparkmeetup.md
Created September 8, 2014 08:49
Spark SQL samples for Spark Meetup
@max-mapper
max-mapper / readme.md
Last active August 29, 2015 14:07 — forked from jlord/readme.md

less commands

  • open a file: less file.log
  • type capital G: go to end of file
  • type small g: go to beginning of file
  • type ?: enter reverse search
  • type /: enter forward search
  • type n: skips to next search match
  • type N: skips back to last search match
@umit
umit / clk.tsv
Last active August 29, 2015 14:19 — forked from ceteri/clk.tsv
2014-03-04 15dfb8e6cc4111e3a5bb600308919594 11
2014-03-06 81da510acc4111e387f3600308919594 61
@umit
umit / jargon.md
Last active August 29, 2015 14:26 — forked from cb372/jargon.md
Category theory jargon cheat sheet

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.

@hubgit
hubgit / schema.xml
Created March 17, 2010 14:39
schema.xml for storing Wikipedia data in Solr
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="wikipedia" version="1.2">
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="1" splitOnCaseChange="0" splitOnNumerics="0" stemEnglishPossessive="1"/>
@emre
emre / sort
Created April 27, 2010 15:08
usort()'un guzel bir ozelligi
<?php
$a[] = array(
"name" => "emre",
"price" => 99,
);
$a[] = array(
"name" => "ali",
"price" => 15,