Skip to content

Instantly share code, notes, and snippets.

View ghacosta's full-sized avatar

Guille Acosta ghacosta

View GitHub Profile
@ghacosta
ghacosta / send-email.php
Last active July 25, 2018 22:39
Send emails using gmail SMTP and PHPMailer
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
require '../vendor/autoload.php';
function sendemail($para, $nombre, $cuerpo, $asunto) {
$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Host = 'smtp.gmail.com';
var sitesList = [
["http://heeeeeeeey.com/"],
["http://tinytuba.com/"],
["http://corndog.io/"],
["http://thatsthefinger.com/"],
["http://cant-not-tweet-this.com/"],
["http://weirdorconfusing.com/"],
["https://www.eyes-only.net/"],
["http://eelslap.com/"],
["http://www.staggeringbeauty.com/"],
@ghacosta
ghacosta / one-line-bash-renamer
Created October 30, 2019 15:11
Rename css file to scss
for file in $(find . -name "*.css"); do mv ${file} ${file%.css}.scss; done
@ghacosta
ghacosta / gist:8f4553ca4297d0c3cd73770f7fdc351b
Created July 3, 2020 16:44
react-select + apollo + async + debounce helpful links
https://react-select.com/async - official docs
https://github.com/apollographql/apollo-client/issues/5268 - working with apollo
https://codesandbox.io/s/react-select-with-uselazequery-5bkpt?file=/src/index.js - select + useLazyQuery example
https://codesandbox.io/s/98vxxr18zw?file=/example.js - async debouce example
https://stackoverflow.com/questions/52695414/react-select-with-react-apollo-does-not-work - async + apollo client
@ghacosta
ghacosta / blackscholes.js
Created July 23, 2020 04:24 — forked from vorandrew/blackscholes.js
Black-Scholes in Javascript: A rewrite of http://www.espenhaug.com/black_scholes.html
/*
PutCallFlag: Either "put" or "call"
S: Stock Price
X: Strike Price
T: Time to expiration (in years)
r: Risk-free rate
v: Volatility
This is the same one found in http://www.espenhaug.com/black_scholes.html
but written with proper indentation and a === instead of == because it's