used to calculate the great circle distance between two points on the earth (specified in decimal degrees)
- Miles: 3956
- Kilometers: 6371
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'json' | |
require 'sinatra' | |
require './analyzer.rb' | |
class SentimentApi < Sinatra::Base | |
disable :logging | |
disable :raise_errors | |
disable :show_exceptions |
set :application, "My Static Content" | |
set :servername, 'test.example.com' | |
# no git? simply deploy a directory | |
set :scm, :none | |
set :repository, "." # the directory to deploy | |
# using git? deploy from local git repository | |
# set :scm, :git | |
# set :repository, 'file//.' # path to local git repository |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
//Public client interface | |
function Client(applicationId, masterKey) { | |
this.applicationId = "applicationId"; | |
this.masterKey = "masterKey"; | |
} | |
exports.Client = Client; | |
//Parse API endpoint | |
var ENDPOINT = 'https://api.parse.com/1/classes/'; |
#This is the "site config" for nginx | |
upstream django { | |
# Distribute requests to servers based on client IP. This keeps load | |
# balancing fair but consistent per-client. In this instance we're | |
# only using one uWGSI worker anyway. | |
ip_hash; | |
server unix:/tmp/uwsgi.sock; | |
} | |
server { |
#!/bin/bash | |
INNOBACKUP="/root/percona-xtrabackup/innobackupex" | |
INNOBACKUP_OPTIONS="--defaults-file=/etc/my.cnf --ibbackup=/root/percona-xtrabackup/mysql-5.5/storage/innobase/xtrabackup/xtrabackup_innodb55 --parallel=4 --user=root --password=XXXXXXX" | |
BACKUPDIR="/var/sqlbackup/" | |
S3BUCKET="db_backup" | |
echo "Removing old local backups" | |
cd $BACKUPDIR |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
(function(A) { | |
var registered_ids = {}, | |
id_to_module_map = {}, | |
interim_actions = {}, | |
cleanup_actions = {}, | |
clicked_ids = {}, | |
queueing = {}; | |
function register_id(id, callbacks, required_module) { | |
id = id.replace('*', '.*'); |