Skip to content

Instantly share code, notes, and snippets.

View durgeshm's full-sized avatar

Durgesh Mankekar durgeshm

View GitHub Profile
@retronym
retronym / mvn2sbt.scala
Created May 3, 2010 17:17
mvn2sbt: quick hack to turn <dependencies> into SBT
object scala {
val version = "SCALA_VERSION$"
}
val xml = <dependencies>
<dependency>
<groupId>org.scalanlp</groupId>
<artifactId>scalala_${scala.version}</artifactId>
<version>0.3.1</version>
</dependency>
@deepak
deepak / redis_schema.txt
Created September 28, 2010 11:42
how to name keys in redis for keyvalue stores
# how to name keys in redis for keyvalue stores
http://code.google.com/p/redis/wiki/TwitterAlikeExample
http://rediscookbook.org/introduction_to_storing_objects.html
http://www.slideshare.net/playnicelyapp/redis-schema-design-for-playnicely-redis-london-meetup
antirez has a book about keyvalue design in the pipeline
http://code.google.com/p/redis/wiki/IntroductionToRedisDataTypes
schema:
<namespace>:<globalObject>
@jorgeortiz85
jorgeortiz85 / gist:906503
Created April 6, 2011 20:52
Scala for-comprehensions
// The way Scala for-comprehensions work is that:
for (x <- c) f(x)
// simply translates to:
c.foreach(x => f(x))
// Likewise:
#!/usr/bin/env ruby
if ARGV.size < 2
$stderr.puts 'usage: monitor <path> <command> [arg1 arg2 ...]'
exit 100
end
PATH = ARGV[0]
COMMAND = ARGV[1]
ARGS = ARGV[2..-1]
@pamelafox
pamelafox / newtalk.html
Created May 23, 2011 18:31
Calculating timezone from city/country
<!DOCTYPE html>
<html">
<head>
<script src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
</head>
<body>
<h2 class="headline">New Talk</h2>
@naryad
naryad / CreateTwitterTable.java
Created July 23, 2011 11:09
Minimal implementation of twitter data layer using HBase
package hbase.sandbox;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.HBaseAdmin;
@mumoshu
mumoshu / run-play-app-in-console.scala
Created January 31, 2012 09:23
Run Play 2.0 app from Play console
// Thanks!
// http://voidy21.hatenablog.jp/entry/2012/01/09/024544
//
// Usage:
// Run `play console` and then :paste the below code
//
// Tested on commit 4727620693 of Play20 master, at Feb 6.
//
// Follow the below steps to enable play.api.test classes in Play console.
// $ set libraryDependencies += "play" %% "play-test" % "2.0-RC1-SNAPSHOT"
@arnabdas
arnabdas / example.html
Created August 1, 2013 08:13
Tri-State Checkbox in AngularJS
<!-- http://plnkr.co/edit/N98IKTcHoZMCs18FjSRF?p=preview -->
The directive assumes that the checkboxes array contains objects that have an isSelected property and a desc property.
<tri-state-checkbox checkboxes="listelements"></tri-state-checkbox>
or
<!-- http://plnkr.co/edit/PTnzedhD6resVkApBE9K?p=preview -->
If you prefer to have the directive only render the tri-stated checkbox, hence the individual checkboxes are in the HTML:
<tri-state-checkbox checkboxes="listelements" class="select-all-cb">
</tri-state-checkbox>select all
@staltz
staltz / introrx.md
Last active June 21, 2024 12:27
The introduction to Reactive Programming you've been missing