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
<?hh | |
class Box<T> | |
{ | |
protected T $data; | |
public function __construct(T $data) | |
{ | |
$this->data = $data; | |
} |
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
<?hh | |
class AnnotatedClass | |
{ | |
public int $x; | |
private string $s; | |
protected array $arr; | |
public AnotherClass $ac; | |
function bar(string $str, bool $b): float |
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
<?hh | |
function check_not_null(?int $x): int | |
{ | |
if ($x === null) | |
{ | |
return -1; | |
} | |
else | |
{ |
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
<?hh | |
$foo = $x ==> $x + 1; | |
$foo(12); | |
// returns 13 | |
bar = ($a, $b) ==> $a + $b; | |
$bar(3, 8); |
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
#include <LiquidCrystal.h> | |
#include <SPI.h> | |
#include <Ethernet.h> | |
#include <string.h> | |
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7); | |
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
char server[] = "www.mysite.com"; | |
IPAddress ip(192,168,0,56); |
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
#include <LiquidCrystal.h> | |
#include <SPI.h> | |
#include <Ethernet.h> | |
#include <string.h> | |
LiquidCrystal lcd(8, 13, 9, 4, 5, 6, 7); | |
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
char server[] = "www.mysite.com"; | |
IPAddress ip(192,168,0,56); |
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 setup() { | |
Serial.begin(9600); | |
lcd.clear(); | |
lcd.begin(16, 2); | |
lcd.setCursor(0,0); lcd.print("Temperature"); | |
lcd.setCursor(0,1); lcd.print("Monitor Tool"); | |
delay(3000); |
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() { | |
lcd.setCursor(0,0); | |
lcd.print("Next Upload: "); | |
lcd.setCursor(13,0); | |
lcd.print(timer); lcd.print(" "); | |
if(sinceLastSend <= 0){ | |
sinceLastSend = sendAfter; | |
timer = sendAfter; | |
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 sendData() { | |
lcd.clear(); | |
lcd.setCursor(0,0); lcd.print("Connecting..."); | |
// Turn the float to a string | |
dtostrf(tempCurrent, 4, 2, tempBuffer); | |
// Build the GET request | |
String getRequest = "GET /homemonitor/log.php?temperature="; |
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
{ | |
"err":"", | |
"suc":"new key 5f72253b673eb49fc64dd34439531b5cca05327f has been set.", | |
"key":"5f72253b673eb49fc64dd34439531b5cca05327f" | |
} |
OlderNewer