Skip to content

Instantly share code, notes, and snippets.

View sabman's full-sized avatar
😀
Building, Shiping, Sharing!

Shoaib Burq sabman

😀
Building, Shiping, Sharing!
View GitHub Profile
@sabman
sabman / .gitignore
Last active May 13, 2016 19:28 — forked from sweenzor/shapely-demo.ipynb
Shapely ipython notebook example
env/
.ipynb_checkpoints/
---
# packages.yml
- name: Add postgres repository
apt_repository: repo='deb http://apt.postgresql.org/pub/repos/apt/ {{ansible_distribution_release}}-pgdg main' state=present
- name: Add postgres repository key
apt_key: url=http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc state=present
- name: Install postgresql
@sabman
sabman / ajax-form.js
Last active August 29, 2015 14:11 — forked from havvg/ajax-form.js
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Maintenance du site</title>
<style>
h1 { color: rgb(220, 129, 0); font-size: 50px; letter-spacing: -5px; position: relative;}
h1:after { color: rgba(100, 200, 255, 0.5); content: "Oh noes!"; left: 4px; position: absolute; top: 5px;}
body { color: rgb(51, 51, 51); font: 20px Helvetica,sans-serif; padding-top: 150px;}
#article { display: block; margin: auto; text-align: left; width: 650px;}
# Setting up a local solr instance on a mac
# install solr with homebrew
brew install solr
# create the base solr index directory
mkdir -p /data/solr
# make sure you can write to the solr logs
sudo chown -R `whoami` /usr/local/Cellar/solr/

a short description of your company and what you do/offer

Today, if a developer wants to build a location aware application, they must first know how to install and use a number of specialized libraries. They need a hosting service where these libraries are available. They must also be familiar with hundreds of geographic data formats and know how to import them into their database. Add to this the need for real-time location-triggered alerts and the developer can spend days researching, experimenting and prototyping to find the right mix of database and libraries for their particular web or mobile application project. Simply put, building sophisticated location aware applications is hard!

Instead wouldn't it be great if you could just sign up and instantly load location data and access spatial functions from your existing app? SpacialDB is built to do just this.

SpacialDB is "location-aware application development made simple".

SpatialDB does this by providing:

@sabman
sabman / .gitignore
Created September 29, 2012 08:48 — forked from bkeepers/.gitignore
My Sublime settings
*
@sabman
sabman / gist:3361112
Created August 15, 2012 15:45 — forked from koos/gist:921728
validates_each :iban do | record, attr, value |
record.errors.add attr, 'IBAN is mandatory' and next if value.blank?
# IBAN code should start with country code (2letters)
record.errors.add attr, 'Country code is missing from the IBAN code' and next unless value.to_s =~ /^[A-Z]{2}/i
iban = value.gsub(/[A-Z]/) { |p| (p.respond_to?(:ord) ? p.ord : p[0]) - 55 }
record.errors.add attr, 'Invalid IBAN format' unless (iban[6..iban.length-1].to_s+iban[0..5].to_s).to_i % 97 == 1
end
@sabman
sabman / geodatabases.md
Created May 27, 2011 10:23 — forked from kashif/geodatabases.md
GeoDatabases - a discussion

GeoDatabases

What is a GeoDatabase? and how is it diff from a regular db

  • Stores geometries
  • multi-dimensional
  • R-Tree indexing (Query planner uses it?)
  • projections
  • Supports Datums ?
  • Vector and raster support
class VisitorStats
def initialize
@redis = Redis.new
end
# every time there's a hit, increment a counter for the
# day and week, and add the session id to a set of unique
# vistitors for the day/week
def hit(session_id)
today = Date.today