Skip to content

Instantly share code, notes, and snippets.

Holiday Resorts

Kerala is a state in India and popularly known as "God’s own Country". It is very famous for the BackWaters, HouseBoats, Food, Culture. There are numerous resorts, hotels and homestays in Kerala. This application provides a fun and interactive way to find a Resort of your choice.

Domain_Model
@cleishm
cleishm / gist:2973636
Created June 22, 2012 15:51
Generate timestamped signature
#!/usr/bin/env ruby
require 'digest/md5'
require 'base64'
if ARGV.length != 1
$stderr.puts "usage: #{$0} secret"
exit 1
end
timestamp = Time.now.to_i
@cleishm
cleishm / gist:2123604
Created March 19, 2012 18:44
Format a time to H:MM:SS.mmm
function formatTime(time) {
var hours = Math.floor(time / 3600000);
var min = Math.floor(((time % 3600000) / 60000));
var sec = Math.floor(((time % 60000) / 1000));
var msec = time % 1000;
if (hours < 10)
hours = '0' + hours;
if (min < 10)
min = '0' + min;
if (sec < 10)
@cleishm
cleishm / RandomDB.java
Created March 2, 2012 01:54
Create a huge neo4j dataset
import org.neo4j.kernel.impl.batchinsert.*;
import org.neo4j.graphdb.*;
import java.util.*;
class RandomDB {
public static void main(final String args[]) {
final Map<String, String> params = new HashMap<String,String>();
params.put("neostore.nodestore.db.mapped_memory", "1024M");
params.put("neostore.relationshipstore.db.mapped_memory", "2048M");
@cleishm
cleishm / gist:1231545
Created September 21, 2011 08:18
Assigning an array of tags or a comma separated list of tags (or a combination)
def tags=(tags)
@tags = [ tags ].flatten.flat_map {|k| k.split(',')}.map(&:strip).uniq
end
@cleishm
cleishm / gowalla.spots.xml
Created November 23, 2010 13:30
Extended version of gowalla.spots.xml for YQL that handles queries
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Zach Graves (zachg@yahoo-inc.com)</author>
<description>Gowalla API</description>
<documentationURL>http://gowalla.com/api/explorer#/spots/18568</documentationURL>
<documentationURL>http://gowalla.com/api/explorer#/spots?lat=30.2697&amp;lng=-97.7494&amp;radius=50</documentationURL>
<sampleQuery>select * from {table} where id=18568 and api_key='fa574894bddc43aa96c556eb457b4009';</sampleQuery>
<sampleQuery>select * from {table} where lat='30.2697' and lng='-97.7494' and radius='50' and api_key='fa574894bddc43aa96c556eb457b4009';</sampleQuery>
</meta>