Skip to content

Instantly share code, notes, and snippets.

View alexyoung's full-sized avatar
💤

Alex Young alexyoung

💤
View GitHub Profile
hp = Helipad.new("[email protected]", "password")
source = File.read("cake_recipe.txt")
response = hp.create(:title => "Cake",
:tags => "recipe",
:source => source)
puts "Recipe saved" if response.saved?
Ico.Base = Class.create({
/* Returns a suitable set of labels for given data points on the Y axis */
labelStep: function(data) {
var min = data.min(),
max = data.max(),
range = max - min,
step = 0;
if (range < 2) {
step = 0.1;
<script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#tabs=web%2Cpost%2Cemail&amp;charset=utf-8&amp;style=default&amp;publisher=lolz"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js"></script>
<script language="javascript" type="text/javascript">
document.observe('dom:loaded', function() {
$$('.ShareThis').each(function(element) {
element.innerHTML = '<a class="stbutton stico_default" title="ShareThis via email, AIM, social bookmarking and networking sites, etc." href="javascript:void(0)"><span class="stbuttontext">ShareThis</span></a>';
var title = element.previous('h2').down('a').innerHTML;
var url = element.previous('h2').down('a').href;
var shareObject = SHARETHIS.addEntry({
require 'net/http'
require 'cgi'
require 'rubygems'
require 'xmlsimple'
class TubeUpdates
API_URL = 'http://api.tubeupdates.com/?method=%s&lines=%s&format=%s'
def initialize(stations, options = {})
@stations = stations
var listDataSource = {
_rowData: [],
// The List calls this method to find out how many rows should be in the list.
numberOfRows: function() {
return this._rowData.length;
},
// The List calls this method once for every row
prepareRow: function(rowElement, rowIndex, templateElements) {
require 'rubygems'
require 'hpricot'
require 'open-uri'
require 'cgi'
class PlayScrape
URL = "http://www.play.com/Search.aspx?searchtype=allproducts&searchstring=%s&page=search&pa=search&go.x=0&go.y=0"
def initialize
end
require 'net/http'
require 'uri'
data = '[email protected]&password=your_password'
url = URI.parse('http://helipadapp.com/authenticate')
headers = {
'Content-Type'=> 'application/x-www-form-urlencoded'
}
http = Net::HTTP.new(url.host)
require 'net/http'
require 'uri'
data = '[email protected]&password=your_password'
url = URI.parse('http://helipadapp.com/authenticate')
headers = {
'Content-Type'=> 'application/x-www-form-urlencoded'
}
http = Net::HTTP.new(url.host)
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Example</title>
<link rel="stylesheet" href="theme/default/style.css" type="text/css" />
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init() {
map = new OpenLayers.Map('map');
var ol_wms = new OpenLayers.Layer.WMS('OpenLayers WMS', 'http://labs.metacarta.com/wms/vmap0?', {layers: 'basic'});
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers Example</title>
<link rel="stylesheet" href="theme/default/style.css" type="text/css" />
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript">
var map, popup, ol_wms;
function init() {
function mousedown(evt) {
if (popup == null) {