Skip to content

Instantly share code, notes, and snippets.

View gerardorochin's full-sized avatar

Gerardo Rochín gerardorochin

View GitHub Profile
<?php
$data = array(
"content" => "Pickle Rick motherfuckers!",
);
$ch = curl_init("https://discordapp.com/api/webhooks/<WEBHOOK_ID>/<TOKEN>");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HEADER, 0);
@gerardorochin
gerardorochin / php_error_logstash.conf
Created June 2, 2014 15:39
php error logging into logstash + elasticsearch and trace errors on single line and root path hidden
input {
file {
type => "php-error"
path => "/var/www/error_log"
sincedb_path => "/opt/logstash/sincedb-access"
}
}
@gerardorochin
gerardorochin / error-install-grub.sh
Last active March 5, 2024 04:49
Fix error generated on the install GRUB on Arch Linux: Syntax errors are detected in generated GRUB config file.
# try:
grub-mkconfig -o /boot/grub/grub.cfg
# output error:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux-ck
Found initrd image: /boot/initramfs-linux-ck.img
Found Windows 8 (loader) on /dev/sda1
error: out of memory.
error: syntax error.
@gerardorochin
gerardorochin / rfc regex
Created June 6, 2013 00:00
Expresion regular para validar RFC
/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/