This file contains 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
<?php | |
// connect | |
$m = new Mongo($_ENV["MONGOLAB_URI"]); | |
// select a database | |
$db = $m->comedy; | |
// select a collection (analogous to a relational database's table) | |
$collection = $db->cartoons; |
This file contains 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
{ | |
"mysql-5.1":[ | |
{ "name":"mysql-78f77", | |
"label":"mysql-5.1", | |
"plan":"free", | |
"tags":["mysql","mysql-5.1","relational"], | |
"credentials": { | |
"name":"d49cb7954b61236b5b9797c7db03fb999", | |
"hostname":"127.0.0.1", | |
"host":"127.0.0.1", |
This file contains 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
<?php | |
$mysql_config = $services["mysql-5.1"][0]["credentials"]; | |
$db = mysql_connect( $mysql_config["hostname"], | |
$mysql_config["username"], | |
$mysql_config["password"]); | |
mysql_select_db( $mysql_config["name"] ); |
This file contains 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
function CloudFoundryClient(token,new_target) | |
{ | |
var vmc_version="0.3.2"; | |
var vmc_default_target="http://api.aws.af.cm"; | |
var vmc_info_path="/info"; | |
var vmc_global_services_path="/info/services"; | |
var vmc_global_runtimes_path="/info/runtimes"; | |
var vmc_resources_path="/resources"; | |
var vmc_apps_path="/apps"; | |
var vmc_services_path="/services"; |
This file contains 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
<form action="" method="POST" id="tryonappfog-form"> | |
<div class="form-row"> | |
<label>Email address</label> | |
<input type="text" size="20" autocomplete="off" class="email"/> | |
</div> | |
<div class="form-row"> | |
<label>Password</label> | |
<input type="Password" size="4" autocomplete="off" class="password"/> | |
</div> | |
<button type="submit" class="submit-button">Try on AppFog</button> |
This file contains 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
<script type="text/javascript" src="https://tryon.appfog.com/launcher.js"></script> |
This file contains 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/telnet' | |
require 'json' | |
require 'cosm-rb' | |
key = "xxx" | |
hostname = '192.168.2.4' | |
port = 4000 | |
localhost = Net::Telnet::new("Host" => hostname, "Port" => port, "Timeout" => 10) |
This file contains 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
{"light"=>"6.3476562500", "moisture"=>"0.0000000000", "temperature"=>"81.2119979858", "humidity"=>"50.8944435119"} | |
{"light"=>"5.7617187500", "moisture"=>"0.0000000000", "temperature"=>"81.2119979858", "humidity"=>"50.0578613281"} | |
{"light"=>"5.9570312500", "moisture"=>"0.0000000000", "temperature"=>"81.2299957275", "humidity"=>"49.8144493103"} | |
{"light"=>"6.8359375000", "moisture"=>"64.0000000000", "temperature"=>"81.5719909667", "humidity"=>"49.1354064941"} |
This file contains 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
void loop() { | |
// read the value from the sensor: | |
if(Serial.available() > 0) | |
{ | |
while(1) | |
{ | |
while(Serial.available()>0) | |
{ | |
int incoming_byte=Serial.read(); |
This file contains 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 _spq = _spq || []; | |
var _spk = _spk || 'eca97bdff43e588dda1aa53c93d781093c793389'; | |
function _sps(u){ | |
setTimeout(function(){ | |
var d = document, f = d.getElementsByTagName('script')[0], | |
s = d.createElement('script'); | |
s.type = 'text/javascript'; s.async = true; s.src = u; | |
f.parentNode.insertBefore(s, f); | |
}, 1); | |
} |
OlderNewer