Skip to content

Instantly share code, notes, and snippets.

View jesobreira's full-sized avatar
💭
Implementing new bugs to fix later.

Jefrey Sobreira Santos jesobreira

💭
Implementing new bugs to fix later.
View GitHub Profile
@jesobreira
jesobreira / push.php
Created February 6, 2018 20:17
Send Push using Google FCM
<?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
jesobreira / example.au3
Last active March 24, 2018 02:50
storage.au3
; https://www.autoitscript.com/forum/topic/193141-storageau3-localstorage-and-sessionstorage/
; sessionStorage (temporary)
; add or modify a key
sessionStorage("foo", "bar")
store("foo", "bar")
sessionStorage_set("foo", "bar")
sessionStorage_setItem("foo", "bar")
@jesobreira
jesobreira / bootstrap-vertical-grid.css
Last active November 21, 2018 05:48 — forked from metaist/bootstrap-vertical-grid.css
Bootstrap vertical grid. For laying out full-screen fixed height webapps.
html,body {
height: 100%;
user-select: none;
}
.container-fixed {
bottom: 0;
position: fixed;
left: 0;
right: 0;
@jesobreira
jesobreira / url-encode.c
Created January 22, 2019 21:21 — forked from sudar/url-encode.c
URL Encoding in C (urlencode / encodeURIComponent)
#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
jesobreira / block.php
Created October 15, 2019 22:17
Parse Blockchain Block Header
<?php
function parse_block($block) {
$return = [
'version' => null,
'prevBlockHash' => null,
'merkleRoot' => null,
'timestamp' => null,
'target' => null,
'nonce' => null
@jesobreira
jesobreira / mod11.js
Last active September 12, 2023 02:43
Digito verificador em PHP e Javascript
/**
* Calculates the Modulo 11 for generating the verification digit of bank slips and bank accounts.
*
* @author Pablo Costa <pablo@users.sourceforge.net>
* @link www.febraban.org.br
*
* @param {string} num Numeric string for which the verification digit is to be calculated.
* @param {number} [base=9] Maximum value of multiplication.
* @param {number} [r=0] Specifies the return type. If 0, returns the verification digit, if 1 returns the remainder.
*