Skip to content

Instantly share code, notes, and snippets.

View renatomattos2912's full-sized avatar

Renato Mattos renatomattos2912

View GitHub Profile
// Get values inside brackets, ex: {{test}}
/{{[{]?(.*?)[}]?}}/g
// Get values started with @, ex: @test
/@[a-zA-Z]*/g
function extractEmailAddresses() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var search = "in:spam is:all ";
var threads = GmailApp.search(search);
var row, messages, from, email;
try {
@renatomattos2912
renatomattos2912 / File_base64.js
Created August 24, 2016 18:27
Working with File in browser and transform base64 back to File Object
var blob = dataURItoBlob(res);
var fd = new FormData(document.forms[0]);
fd.append("canvasImage", blob);
var file = dataURLtoFile(res, 'a.jpeg');
function dataURItoBlob(dataURI) {
var binary = atob(dataURI.split(',')[1]);
var array = [];
for(var i = 0; i < binary.length; i++) {
@renatomattos2912
renatomattos2912 / jekyllrb-watch-css.json
Created May 18, 2015 14:57
Jekyllrb Generator Grunt Css Corretor
watch: {
jekyll: {
files: [
'<%= yeoman.app %>/**/*.{html,yml,md,mkd,markdown}',
'!<%= yeoman.app %>/_bower_components/**/*'
],
tasks: ['jekyll:server']
},
css: {
files: '<%= yeoman.app %>/css/**/*.css',
@renatomattos2912
renatomattos2912 / angular-basic.js
Created November 26, 2014 17:51
Basic angular js file
(function(){
'use strict';
/**
* @ngdoc <type>
* @name app
* @function
*
* @description
* <description>
@renatomattos2912
renatomattos2912 / py-simple-server
Created August 12, 2014 17:10
Pyton simple server
python -m SimpleHTTPServer
@renatomattos2912
renatomattos2912 / angular-http.js
Created July 31, 2014 13:56
Metodo $http do angular com parametros
$http({
method: 'POST',
url: ref + 'user/rule/new',
data: $.param(cliente),
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}).success(function(cb){
console.log(cb);
});
@renatomattos2912
renatomattos2912 / firebase-structure
Created June 26, 2014 18:51
Firebase structure
{
"categorias" : {
"categoria2" : {
"subcategorias" : {
"subcategoria4" : {
"nome" : "Subcategoria 4"
},
"subcategoria6" : {
"nome" : "Subcategoria 6"
},
@renatomattos2912
renatomattos2912 / flatify-navbar
Last active August 29, 2015 14:02
Flatify navbar problem
<div id="nav-wrapper" data-ng-controller="CategoriaCtrl">
<ul id="nav" data-collapse-nav data-slim-scroll data-highlight-active>
<li ng-repeat="(categoriaId, categoria) in categorias">
<a href>
<i class="fa {{categoria.icone}}">
<span class="icon-bg bg-warning"></span></i>{{categoria.nome}}
</a>
<ul>
@renatomattos2912
renatomattos2912 / gitignore front
Created April 11, 2014 23:10
gitigonore para front end
# Folders
_site/
node_modules/
tmp/
.tmp/
build/
.vagrant/
log/
.log/
$RECYCLE.BIN/