Skip to content

Instantly share code, notes, and snippets.

@alfredbaudisch
alfredbaudisch / BrPhoneNumberFormatter.java
Created September 23, 2015 00:38
Android EditText mask for Brazilian telephone numbers. It deals with the default format (xx) xxxx-xxxx as well the newer longer one (xx) xxxxx-xxxx. Máscara de telefones brasileiros para EditText do Android: formata tanto o telefone padrão (xx) xxxx-xxxx, quanto o novo formato (xx) xxxxx-xxxx.
/**
* Adapted to BR phone format from the class
* UsPhoneNumberFormatter by Samik Bandyopadhyay:
* http://stackoverflow.com/a/23659268/332839
*/
public class BrPhoneNumberFormatter implements TextWatcher {
final int MAX_LENGTH = 11;
//This TextWatcher sub-class formats entered numbers as (41) 1234(5)?-6789
@iheartmedia-matt
iheartmedia-matt / .htaccess
Created August 15, 2018 14:46
Apache .htaccess SSL React Router
<ifModule mod_rewrite.c>
#######################################################################
# GENERAL #
#######################################################################
# Make apache follow sym links to files
Options +FollowSymLinks
# If somebody opens a folder, hide all files from the resulting folder list
@prasofty
prasofty / margin_padding_helper.css
Last active April 10, 2023 17:29
Margin Padding Helper CSS
.p-0 {
padding: 0px;
}
.p-3 {
padding: 3px;
}
.p-5 {
padding: 5px;
@oliverswitzer
oliverswitzer / nonModuleDirList.js
Created February 24, 2014 19:01
An example of a script that will filter files with certain extensions in Node.js
// asynchDirList.js
var fs = require('fs'); //require node filesystem module
var path = require('path'); //require node path module (a couple of tools for reading path names)
var pathSupplied = process.argv[2];
var extFilter = process.argv[3];
function extension(element) {
var extName = path.extname(element);