Skip to content

Instantly share code, notes, and snippets.

@geoloqi
geoloqi / gist:1129641
Created August 6, 2011 19:01
Example code for posting a location update to the Geoloqi API
<?php
// Get a permanent access token from the developers website https://developers.geoloqi.com/getting-started
$permanentToken = '';
$timestamp = time();
$latitude = 45.524;
$longitude = -122.6843;
$speed = 0;
$altitude = 0;
@geoloqi
geoloqi / engine.rb
Created July 27, 2011 23:15
Class for determining platform/version of ruby used. Stolen from bundler.
require 'rbconfig'
module Engine
WINDOWS = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
class << self
def ruby?
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx")
end
def ruby_18?
<?php
include('GoogleVoice.php');
$gv = new GoogleVoice('your.username', 'yourpassword');
try
{
$gv->sendSMS('9995551212', 'This is your message');
}
catch(Exception $e)
<?php
/**
* Convert minutes into a human-readable format.
* i.e. 60 minutes = 1 hour, 10080 minutes = 1 week
*
* Examples:
* 1530 minutes is 1 day, 1 hour, 30 minutes
* minutesToText(1530, array('rounded'=>0)) = 1 day
* minutesToText(1530, array('rounded'=>1)) = 1.1 days
* minutesToText(1530, array('units'=>1)) = 1 day
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
var last = {lat: 45.5, lng: -122.6};