Skip to content

Instantly share code, notes, and snippets.

View harshamv's full-sized avatar
Working from home

Harsha MV harshamv

Working from home
View GitHub Profile
View FB like webhook
window.fbAsyncInit = function () {
appId: 'APPID',
Status: true,
Cookie: true,
Xfbml: true
FB.Event.subscribe('edge.create', function (response) {
Alert("Hello World! URL Liked!");
View gist:9658664
FB.Event.subscribe('edge.create', function(targetUrl) {
_gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]);
View Birthday_Validation_rails
validates_inclusion_of :birthday,
:in =>,
:message => 'Too young, dude!'
View HideMobileAddressBar.js
function hideAddressBar()
if(document.height < window.outerHeight)
{ = (window.outerHeight + 50) + 'px';
setTimeout( function(){ window.scrollTo(0, 1); }, 50 );
harshamv / .htaccess
Created June 27, 2014 15:19
GZIP Apache Server
View .htaccess
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
<IfModule mod_setenvif.c>
# Netscape 4.x has some problems
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
View geocoder_example.html
<!DOCTYPE html>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Google Maps JavaScript API v3 Example: Geocoding Simple</title>
<link href="" rel="stylesheet">
<script src=""></script>
# mongodump reference:
# Author: Lazaro Lima -
View gist:f1780ef656cef4446d3e,51.551230
View labelled_marker.js
* An example of how to use a Google Map overlay to display a label on top of marker.
* This is a slight re-work of
* I suggest you rather view that blog post, this code is pasted here purely for my own personal reference.
point = {
lat: 37.8478115,
long: 15.2934327
View Google Distance API
# Google Direction API
include HTTParty
format :json
def api_key
# Your API key
def direciton_api_url