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
| hp = Helipad.new("lonnon@example.com", "password") | |
| source = File.read("cake_recipe.txt") | |
| response = hp.create(:title => "Cake", | |
| :tags => "recipe", | |
| :source => source) | |
| puts "Recipe saved" if response.saved? |
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
| 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; |
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 '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 |
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
| 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) { |
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 '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 |
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 'net/http' | |
| require 'uri' | |
| data = 'email=test@example.com&password=your_password' | |
| url = URI.parse('http://helipadapp.com/authenticate') | |
| headers = { | |
| 'Content-Type'=> 'application/x-www-form-urlencoded' | |
| } | |
| http = Net::HTTP.new(url.host) |
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 'net/http' | |
| require 'uri' | |
| data = 'email=test@example.com&password=your_password' | |
| url = URI.parse('http://helipadapp.com/authenticate') | |
| headers = { | |
| 'Content-Type'=> 'application/x-www-form-urlencoded' | |
| } | |
| http = Net::HTTP.new(url.host) |
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
| <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'}); |
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
| <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) { |
OlderNewer