Skip to content

Instantly share code, notes, and snippets.

Implementing new bugs to fix later.

Jefrey Sobreira Santos jesobreira

Implementing new bugs to fix later.
Block or report user

Report or block jesobreira

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jesobreira / block.php
Created Oct 15, 2019
Parse Blockchain Block Header
View block.php
function parse_block($block) {
$return = [
'version' => null,
'prevBlockHash' => null,
'merkleRoot' => null,
'timestamp' => null,
'target' => null,
'nonce' => null
jesobreira / url-encode.c
Created Jan 22, 2019 — forked from sudar/url-encode.c
URL Encoding in C (urlencode / encodeURIComponent)
View url-encode.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char* urlencode(char* originalText)
// allocate memory for the worst possible case (all characters need to be encoded)
char *encodedText = (char *)malloc(sizeof(char)*strlen(originalText)*3+1);
jesobreira / bootstrap-vertical-grid.css
Last active Nov 21, 2018 — forked from metaist/bootstrap-vertical-grid.css
Bootstrap vertical grid. For laying out full-screen fixed height webapps.
View bootstrap-vertical-grid.css
html,body {
height: 100%;
user-select: none;
.container-fixed {
bottom: 0;
position: fixed;
left: 0;
right: 0;
View example.au3
; sessionStorage (temporary)
; add or modify a key
sessionStorage("foo", "bar")
store("foo", "bar")
sessionStorage_set("foo", "bar")
sessionStorage_setItem("foo", "bar")
jesobreira / push.php
Created Feb 6, 2018
Send Push using Google FCM
View push.php
// Firebase Cloud Messaging Authorization Key
define('FCM_AUTH_KEY', 'your key here');
function sendPush($to, $title, $body, $icon, $url) {
$postdata = json_encode(
'notification' =>
jesobreira / sendgrid.php
Created Feb 6, 2018
Send email using Sendgrid (no lib or curl needed)
View sendgrid.php
define('SENDGRID_KEY', 'SG.your api key here');
function sendgrid($from, $to, $subject, $message) {
$postdata = json_encode(
'personalizations' => [
'to' => [
jesobreira / Example_ParseStr.au3
Created Apr 17, 2017
AutoIt ParseURL and ParseStr
View Example_ParseStr.au3
#include <Array.au3> ; need only to do _ArrayDisplay, not needed by the lib
Result is:
[0][0] = 2
[0][1] = ununsed
[1][0] = foo
View gist:c73c9d114bad13a995ecef671e52f8ee
#include <Array.au3>
#Region Math
Func RelativelyPrime($x, $y)
Return gdc($x, $y) = 1
Func gdc($a, $b)
jesobreira / example.php
Last active May 1, 2016
PHP AutoIt-like INI file management
View example.php
All Ini-related functions from AutoIt are available.
Just add the paamayim nekudotayim (::) between "Ini" and the functio.
E.g.: IniWrite becomes Ini::Write, IniReadSectionNames becomes Ini::ReadSectionNames
include 'phpini.class.php';
jesobreira / monitor.php
Last active May 26, 2018
Server Monitor
View monitor.php
The aim is to create a functional server monitor based on the one
showed on Mark Zuckerberg's monitor on The Social Network movie.
Run so:
php monitor.php
- The server LogFormat must be "Common Log Format" (%h %^[%d:%^] "%r" %s %b)
You can’t perform that action at this time.