Skip to content

Instantly share code, notes, and snippets.

View Rodrigo54's full-sized avatar
🏳️‍🌈
Working

Rodrigo Alves Rodrigo54

🏳️‍🌈
Working
View GitHub Profile
@willnss
willnss / gist:3246637
Created August 3, 2012 10:52 — forked from leonardofaria/gist:1037052
Gerador de CPF, NIT, CNPJ e CEI válidos
<html>
<head>
<title>Gerador de CPF, CNPJ e NIT Válidos</title>
<script language="javascript">
function gera_random(n) {
var ranNum = Math.round(Math.random()*n);
return ranNum;
}
function mod(dividendo,divisor) {
@jonatanfroes
jonatanfroes / MY_Form_validation.php
Created August 20, 2012 14:16
CodeIgniter My_Form_validation p/ validação de CPF e outros
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* MY_Form_validation Class
*
* Extends Form_Validation library
*
*/
class MY_Form_validation extends CI_Form_validation {
function __construct()
@rxaviers
rxaviers / gist:7360908
Last active May 23, 2024 23:28
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@roundand
roundand / OpenWithSublimeText3.bat
Last active March 13, 2024 17:38 — forked from mrchief/LICENSE.md
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@taufik-nurrohman
taufik-nurrohman / php-html-css-js-minifier.php
Last active February 23, 2024 04:30
PHP Function to Minify HTML, CSS and JavaScript
<?php
// Based on <https://github.com/mecha-cms/x.minify>
namespace x\minify\_ { // start namespace
$n = __NAMESPACE__;
\define($n . "\\token_boolean", '\b(?:true|false)\b');
\define($n . "\\token_number", '-?(?:(?:\d+)?\.)?\d+');
@hieblmedia
hieblmedia / php.bat
Created December 4, 2015 23:25
Dynamic PHP executabe for wampserver depend on current enabled version. [tested on Windows10 with Wampserver3_x86]
@REM This file detects the current enabled PHP version of wampserver (http://www.wampserver.com/) and executes the enabled php.exe and all parameters are passed
@REM Copy this file to WAMPSERVERPATH\bin\php
@REM Now you can add WAMPSERVERPATH\bin\php to your Windows Environment-Variable "PATH". Now you can use "php" global. For example "php -v".
@REM You can show the current PHP version with "php -v"
@setlocal enableextensions enabledelayedexpansion
@echo off
set serverPath="%~dp0\..\.."
set file="!serverPath!\wampmanager.conf"
@Ema4rl
Ema4rl / API_Controller.php
Last active May 14, 2017 01:58
Codeigniter Restserver DELETE method with request body [HACK]
require APPPATH.'libraries/REST_Controller.php';
class API_Controller extends REST_Controller
{
/**
* Parse the DELETE request arguments [HACK]
*
* @access protected
@suissa
suissa / promise.md
Created January 26, 2017 12:54 — forked from wkrueger/promise.md
Guia Promise

Guia Promises

Pode-se afirmar que no momento Promises são a forma mais "padrão" de se tratar com assincronismo no JS. Para quem trabalha com javascript, conhecê-las é essencial. Uma dificuldade comum é que esta API tem uma curva de aprendizado um tanto acentuada de início, especialmente se comparado com as alternativas mais antigas: callbacks e o módulo async. No meu caso, levei ao menos uns 3 meses pra "cair a ficha".

Tentarei aqui fazer uma introdução ao assunto, com foco em passar muitos exemplos. Algumas vezes posso sacrificar

@jesperorb
jesperorb / cors.md
Last active February 21, 2024 14:17
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Access-Control-Allow-Origin
@LayZeeDK
LayZeeDK / angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Last active May 23, 2024 18:38
Angular CLI, Angular, Node.js, TypeScript, and RxJS version compatibility matrix. Officially part of the Angular documentation as of 2023-04-19 https://angular.io/guide/versions
Angular CLI version Angular version Node.js version TypeScript version RxJS version
~16.0.0 ~16.0.0 ^16.13.0 || ^18.10.0 >=4.9.5 <5.1.0 ^6.5.5 || ^7.4.0
~15.2.0 ~15.2.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.1.0 ~15.1.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.0.5 ~15.0.4 ^14.20.0 || ^16.13.0 || ^18.10.0 ~4.8.4 ^6.5.5 || ^7.4.0
~14.3.0 ~14.3.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.2.0 ~14.2.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.1.3 ~14.1.3 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~14.0.7 ~14.0.7 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~13.3.0 ~13.3.0 ^12.20.2 || ^14.15.0 || ^16.10.0 >=4.4.4 <4.7.0 ^6.5.5 || ^7.4.0