Skip to content

Instantly share code, notes, and snippets.

View rafaelbriet's full-sized avatar

Rafael Briet rafaelbriet

View GitHub Profile
@Namek
Namek / TagsLayersEnumBuilder.cs
Last active February 26, 2023 21:28
Tags and Layers Enums Builder for Unity3D
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using UnityEditor;
using System;
using System.IO;
using System.Text;
public class TagsLayersEnumBuilder : EditorWindow {
[MenuItem("Edit/Rebuild Tags And Layers Enums")]
@dmnsgn
dmnsgn / .eslintrc.js
Created July 23, 2015 13:31
.eslintrc Google JavaScript Style Guide (eslint v0.24.1)
{
// http://eslint.org/docs/rules/
"env": {
"browser": true, // browser global variables.
"node": false, // Node.js global variables and Node.js-specific rules.
"worker": false, // web workers global variables.
"amd": false, // defines require() and define() as global variables as per the amd spec.
"mocha": false, // adds all of the Mocha testing global variables.
"jasmine": false, // adds all of the Jasmine testing global variables for version 1.3 and 2.0.
@mariojrrc
mariojrrc / brazilianPhoneParser.php
Last active October 13, 2020 20:13
Função para validação e extração de telefones (celular ou fixo) no Brasil. A expressão leva em conta o formato internacional/nacional, com ou sem o DDD, de telefones fixos e celulares. Adaptado de https://gist.github.com/boliveirasilva/c927811ff4a7d43a0e0c
<?php
declare(strict_types=1);
/**
* A função abaixo demonstra o uso de uma expressão regular que identifica, de forma simples, telefones válidos no Brasil.
* Exemplos válidos: +55 (21) 98888-8888 / 9999-9999 / 21 98888-8888 / 5511988888888 / +55 (021) 98888-8888 / 021 99995-3333
*
* @param string $phoneString
* @param bool $forceOnlyNumber Passar false caso não queira remover o traço "-"
* @return array|null ['ddi' => 'string', 'ddd' => string , 'number' => 'string']