This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SmileApi | |
require 'uri' | |
def get_session | |
user_name = "username here" | |
password = "password here" | |
data = File.read("http://api.smilesn.com/session?username="+username+"&password="+password) | |
data=JSON.parse(data) | |
sessionid=data.sessionid | |
file2 = File.open('session.txt', 'w') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAX_DISTANCE_AWAY_IN_KM = 100.0 | |
RAD_PER_DEG = 0.017453293 | |
Rmiles = 3956 # radius of the great circle in miles | |
Rkm = 6371 # radius in kilometers, some algorithms use 6367 | |
Rfeet = Rmiles * 5282 # radius in feet | |
Rmeters = Rkm * 1000 # radius in meters | |
def haversine_distance( lat1, lon1, lat2, lon2 ) | |
dlon = lon2 - lon1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | |
/* */ | |
/* Simple node js module to get distance between two coordinates. */ | |
/* */ | |
/* Code transformed from Chris Veness example code - please refer to his website for licensing */ | |
/* questions. */ | |
/* */ | |
/* */ | |
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2011 */ | |
/* - www.movable-type.co.uk/scripts/latlong.html */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIImage+Tools.h | |
// FTLibrary | |
// | |
// Created by Ondrej Rafaj on 26/09/2011. | |
// Copyright (c) 2011 Fuerte International. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tab.emailValidation = function checkMail(email) { | |
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; | |
if (filter.test(email)) { | |
return true; | |
} | |
return false; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tab.Storage = _.extend({ | |
setItem: function (itemID, value) { | |
if('localStorage' in window && window['localStorage'] !== null){ | |
localStorage.setItem(itemID, value); | |
}else{ | |
$.cookie(itemID, value, { path: '/' }); | |
} | |
}, | |
getItem: function (itemID) { | |
if('localStorage' in window && window['localStorage'] !== null){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{"id":0,"startDate":"04/11/2013","serviceID":241,"providerID":223,"timeSlots":["09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00"]}, | |
{"id":0,"startDate":"05/11/2013","serviceID":241,"providerID":223,"timeSlots":["09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00"]},{"id":0,"startDate":"06/11/2013","serviceID":241,"providerID":223,"timeSlots":["09:00","12:00","13:00","14:00","15:00","16:00"]},{"id":0,"startDate":"07/11/2013","serviceID":241,"providerID":223,"timeSlots":["09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00"]},{"id":0,"startDate":"08/11/2013","serviceID":241,"providerID":223,"timeSlots":["09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00"]},{"id":0,"startDate":"11/11/2013","serviceID":241,"providerID":223,"timeSlots":["09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00"]},{"id":0,"startDate":"12/11/2013","serviceID":241,"providerID":223,"timeSlots":["09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00"]}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Authorize(Roles = "Manager")] | |
public ActionResult Logo() | |
{ | |
return View(); | |
} | |
[Authorize(Roles = "Manager")] | |
[HttpPost] | |
public ActionResult Logo(HttpPostedFileBase file) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- using the truncate filter --> | |
{% for post in site.posts limit:10 %} | |
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2> | |
<span class="post-date">{{ post.date | date: "%B %d, %Y" }}</span> | |
{% if post.content.size > 2000 %} | |
{{ post.content | truncatewords: 300 }} <!-- bad! content gives you rendered html and you will truncate in the middle of a node --> | |
<a href="{{ post.url }}">read more</a> | |
{% else %} | |
{{ post.content }} | |
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/capistrano" | |
server "<Server-name>", :web, :app, :db, primary: true | |
set :application, "<Site-Name>" | |
set :user, "deployer" | |
set :deploy_to, "/home/#{user}/apps/#{application}" | |
set :deploy_via, :remote_cache | |
set :use_sudo, false |