Skip to content

Instantly share code, notes, and snippets.

View emmgfx's full-sized avatar
🏠
Working from home

Josep Viciana emmgfx

🏠
Working from home
View GitHub Profile
@emmgfx
emmgfx / recaptcha.php
Created July 20, 2016 08:07
Check Recaptcha
<?php
if(checkRecaptcha($_POST['g-recaptcha-response'])){
# Recaptcha OK
}else{
# Recaptcha KO
}
function checkRecaptcha($recaptcha_response){
$url = 'https://www.google.com/recaptcha/api/siteverify';
<?php
function checkRecaptcha($recaptcha_response){
$url = 'https://www.google.com/recaptcha/api/siteverify';
$fields = array(
'secret' => 'YOUR_SECRET_KEY',
'response' => $recaptcha_response,
);
$fields_string = '';
@emmgfx
emmgfx / 0-send-email-plesk.php
Last active March 2, 2024 11:49
Send email with PHPMailer and SMTP, default and Plesk
<?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';
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);
@emmgfx
emmgfx / class.mr.php
Created June 25, 2018 15:16
Test mailrelay
<?php
class MR {
private $url = null;
private $apikey = null;
public $id_package = null;
function __construct($url, $apikey){
$this->url = $url;