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
window.fbAsyncInit = function () {
FB.init({
appId: 'APPID',
Status: true,
Cookie: true,
Xfbml: true
});
FB.Event.subscribe('edge.create', function (response) {
Alert("Hello World! URL Liked!");
});
FB.Event.subscribe('edge.create', function(targetUrl) {
_gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]);
});
validates_inclusion_of :birthday,
:in => Date.new(1900)..Time.now.years_ago(18).to_date,
:message => 'Too young, dude!'
function hideAddressBar()
{
if(!window.location.hash)
{
if(document.height < window.outerHeight)
{
document.body.style.height = (window.outerHeight + 50) + 'px';
}
setTimeout( function(){ window.scrollTo(0, 1); }, 50 );
@harshamv
harshamv / .htaccess
Created June 27, 2014 15:19
GZIP Apache Server
<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
<!DOCTYPE html>
<html>
<head>
<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="https://developers.google.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
#!/bin/bash
# mongodump reference: http://www.nacaolivre.com.br/servidor/mysql-backup-com-mysqldump/
# Author: Lazaro Lima - www.lazarolima.com.br
#
S3_BUCKET_NAME="condomundo-databases-snapshots"
S3_BUCKET_PATH="mysql-backups"
MYSQLROOT="yourUserName"
MYSQLPASS="yourPassword"
maps.google.com/maps?q=25.279139,51.551230
/*
* 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 http://www.tdmarketing.co.nz/blog/2011/03/09/create-marker-with-custom-labels-in-google-maps-api-v3/
* I suggest you rather view that blog post, this code is pasted here purely for my own personal reference.
*/
var
point = {
lat: 37.8478115,
long: 15.2934327
# Google Direction API
include HTTParty
format :json
def api_key
# Your API key
end
def direciton_api_url