Skip to content

Instantly share code, notes, and snippets.

View littleoak's full-sized avatar

João Paulo littleoak

View GitHub Profile
@gabrielfroes
gabrielfroes / emailmask.js
Created February 21, 2018 14:57
Javascript Email Mask
/*
Create a Mask in an email address
This function create a mask using a valid email address.
This is usefull when someone need to confirm the email used in a system
Author: Gabriel Froes - https://gist.github.com/gabrielfroes
*/
function emailMask(email) {
var maskedEmail = email.replace(/([^@\.])/g, "*").split('');
var previous = "";
for(i=0;i<maskedEmail.length;i++){
@knoonrx
knoonrx / Extenso.php
Last active December 28, 2022 09:33
Converte números e exibe por extenso em php Fonte: http://www.dirceuresende.com/blog/escrevendo-numero-por-extenso-no-php/
<?php
/**
* Created by PhpStorm.
* User: Rodrigo Brandão
* Date: 21/03/2016
* Time: 11:07
*/
class Extenso
{
public static function removerFormatacaoNumero( $strNumero )
@ZiTAL
ZiTAL / index.php
Last active June 30, 2021 18:45
php: telegram bot api example
<?php
// get API KEY: https://core.telegram.org/bots#botfather
// get chad id: http://stackoverflow.com/questions/31078710/how-to-obtain-telegram-chat-id-for-a-specific-user
$api_key = 'FAKE1234';
$chat_id = '7850602'
$url = "https://api.telegram.org/bot".$api_key."/";
// UNCOMMENT desired method
@baamenabar
baamenabar / curl_get_or_save_functions.php
Created September 10, 2012 13:59
PHP cURL get or save simple stuff
<?php
/****************************************************************************
PHP CURL functions for getting data or asytnchronously saving it to file.
It is header redirect tolerant. like the 302 http status.
Save data to file with cURL: save_data_to_file_w_curl($url,$pathToFile);
Get data with cURL get_data_w_curl($url);
/**
* MIT License