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 | |
class MR { | |
private $url = null; | |
private $apikey = null; | |
public $id_package = null; | |
function __construct($url, $apikey){ | |
$this->url = $url; |
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
const int sensorPin = A0; | |
const int ledGreenPin = 2; | |
const int ledYellowPin = 3; | |
const int ledRedPin = 4; | |
const float temperatureCorrect = 19.0; | |
const float temperatureRaised = 20.0; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(ledGreenPin, OUTPUT); |
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 | |
date_default_timezone_set('Europe/Madrid'); | |
require_once 'PHPMailer-5.2.16/PHPMailerAutoload.php'; | |
$mail = new PHPMailer; | |
$mail->isSMTP(); | |
$mail->SMTPDebug = 2; # 0 off, 1 client, 2 client y server | |
$mail->CharSet = 'UTF-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
<?php | |
function checkRecaptcha($recaptcha_response){ | |
$url = 'https://www.google.com/recaptcha/api/siteverify'; | |
$fields = array( | |
'secret' => 'YOUR_SECRET_KEY', | |
'response' => $recaptcha_response, | |
); | |
$fields_string = ''; |
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 | |
if(checkRecaptcha($_POST['g-recaptcha-response'])){ | |
# Recaptcha OK | |
}else{ | |
# Recaptcha KO | |
} | |
function checkRecaptcha($recaptcha_response){ | |
$url = 'https://www.google.com/recaptcha/api/siteverify'; |
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
Number.prototype.pad = function(size) { | |
var s = String(this); | |
while (s.length < (size || 2)) {s = "0" + s;} | |
return s; | |
} | |
// Examples: | |
var i = 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
$age = date_diff(date_create($bdate), date_create('now'))->y; |
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 | |
namespace ... | |
... | |
use Symfony\Component\Debug\Debug; | |
Debug::enable(); | |
class ... extends Controller |
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
# Editor configuration, see http://editorconfig.org | |
root = true | |
[*] | |
charset = utf-8 | |
indent_style = space | |
indent_size = 4 | |
insert_final_newline = true | |
trim_trailing_whitespace = true |
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
// Example of use: remove(i, savedProfiles); | |
public static JSONArray remove(final int idx, final JSONArray from) { | |
final List<JSONObject> objs = asList(from); | |
objs.remove(idx); | |
final JSONArray ja = new JSONArray(); | |
for (final JSONObject obj : objs) { | |
ja.put(obj); | |
} |
NewerOlder