Skip to content

Instantly share code, notes, and snippets.

View wallace7souza's full-sized avatar

wallace souza wallace7souza

View GitHub Profile
@wallace7souza
wallace7souza / SeleniumCrawlerBuilder
Last active August 29, 2015 14:07
Java classes for selenium crawler,
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
@wallace7souza
wallace7souza / Base64FileToImage
Created December 5, 2014 16:36
Java base64 image text to PNG file
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.apache.commons.codec.binary.Base64;
public class Base64FileToImage {
@wallace7souza
wallace7souza / gist:8c649bd90fe13ce904cb
Created March 25, 2015 20:44
Angularjs dateTime format filter using moment.js
'use strict';
/**
* @ngdoc filter
* @function
* @description
* # dateTimeFormat
* Filter in the engagedAcademicApp.
*/
angular.module('myApp')
@wallace7souza
wallace7souza / gist:2e80dbff5ec292dd1342
Created April 2, 2015 14:16
angular relative date translation for pt_Br
angular.module('YOUR_APP').value('relativeDateTranslations', {
just_now: 'Agora',
seconds_ago:'a {{time}} segundos',
a_minute_ago:'a 1 min',
minutes_ago:'a {{time}} min',
an_hour_ago:'a 1h',
hours_ago:'a {{time}}h',
a_day_ago:'Ontem',
days_ago:'a {{time}} dias',
a_week_ago:'a 1 semana',
@wallace7souza
wallace7souza / util
Created May 27, 2015 16:16
Javascript regex e-mail validate
function is_email(email){
var er = /^[a-zA-Z0-9][a-zA-Z0-9\._-]+@([a-zA-Z0-9\._-]+\.)[a-zA-Z-0-9]{2}/;
if( !er.exec(email) )
{
return false;
}
return true;
}
@wallace7souza
wallace7souza / gist:c3a2908c86ead2444ebd
Created August 31, 2015 05:09
AngularJS Formly multicheckbox example
{
"key": "diasEmQueTrabalha",
"type": "multiCheckbox",
"templateOptions": {
"label": "Dias em que trabalha",
"labelProp":"label",
"valueProp":"value",
"required":true,
"options": [
{
@wallace7souza
wallace7souza / gist:a1897a7ba8280ebbfee2
Created September 1, 2015 03:24
Angularjs formly angucomplete type
formlyConfig.setType({
name: 'angucomplete-remote',
//template: '<input show-weeks="false" class="form-control" min-date="to.minDate" ng-model="model[options.key]" is-open="to.isOpen" datepicker-options="to.datepickerOptions" />',
template: '<angucomplete-alt id="{{to.id}}" placeholder="{{to.placeholder}}" pause="{{to.pause}}" selected-object="model[options.key]" remote-url="'+endpoint+'{{to.url}}" '+
'description-field="{{to.label}}" search-fields="{{to.searchField}}" text-no-results="{{to.textNoResults}}" input-class="form-control form-control-small" title-field="{{to.titleField}}" match-class="{{to.matchClass}}" text-searching="{{to.textSearching}}"/>',
//templateUrl: 'datepicker.html',
wrapper: ['bootstrapLabel', 'bootstrapHasError'],
defaultOptions: {
ngModelAttrs: ngModelAttrs,
templateOptions: {
@wallace7souza
wallace7souza / gist:81e4c89eb7bf685d4d3c
Last active February 24, 2016 13:12
Gulp task for ionic put bower dependecies inject into index.html
gulp.task('dep-inject',function(done){
//Removing angularjs,ionic-bundle put angular already
var depInject = bowerFiles();
var idxRemove = -1;
for(var x=1;x<depInject.length;x++){
if(depInject[x].indexOf('angular.js')>-1){
idxRemove = x;
break;
}
@wallace7souza
wallace7souza / ddi.json
Created February 29, 2016 15:37
DDI json format
[{"ddi":"93","pais":"AFEGANISTAO"},
{"ddi":"27","pais":"AFRICA DOUL"},
{"ddi":"1","pais":"ALASCA"},
{"ddi":"355","pais":"ALBANIA"},
{"ddi":"49","pais":"ALEMANHA"},
{"ddi":"376","pais":"ANDORRA"},
{"ddi":"244","pais":"ANGOLA"},
{"ddi":"1","pais":"ANGUILLA"},
{"ddi":"599","pais":"ANT.HOLANDESAS"},
{"ddi":"1","pais":"ANTIGUA"},
@wallace7souza
wallace7souza / Save string as file with javascript on browser
Created May 20, 2016 15:13
Save string as file with javascript on browser
window.open('data:text/csv;charset=utf-8,' + escape(YOUR_VARIABLE_TEXT));