Skip to content

Instantly share code, notes, and snippets.

Avatar

João Gabriel Lima jgabriellima

View GitHub Profile
View ng-tweet.js
(function() {
'use strict';
angular.module('ngTweets', []).service('tweets', ["$http", function($http) {
var service = this;
this.get = function(config) {
return $http({
url: url(config.widgetId, config.lang),
method: 'JSONP',
transformResponse: appendTransform($http.defaults.transformResponse, function(value) {
return parse(value);
View localstorageservice.js
'use strict';
/**
* @ngdoc function
* @name $localstorage
* @description
* # $localstorage
*/
angular.module('app').factory('$localstorage', function($window) {
return {
set: function(key, value) {
View cpf.js
function isCPF(value) {
console.log(value);
// value = jQuery.trim(value);
cpf = value.toString(); //.replace(/.|-|/gi, ''); // elimina .(ponto), -(hifem) e /(barra)
while (cpf.length < 11) cpf = "0" + cpf;
var expReg = /^0+$|^1+$|^2+$|^3+$|^4+$|^5+$|^6+$|^7+$|^8+$|^9+$/;
var a = [];
var b = new Number;
var c = 11;
for (i = 0; i < 11; i++) {
@jgabriellima
jgabriellima / mask.js
Created Feb 17, 2016
mascara javascript
View mask.js
var v_obj, v_fun;
function mascara(o, f) {
v_obj = o;
v_fun = f;
setTimeout("execmascara()", 1);
}
function execmascara() {
v_obj.value = v_fun(v_obj.value);
View linkify.js
if (!String.linkify) {
String.prototype.linkify = function() {
// http://, https://, ftp://
var urlPattern = /\b(?:https?|ftp):\/\/[a-z0-9-+&@#\/%?=~_|!:,.;]*[a-z0-9-+&@#\/%=~_|]/gim;
// www. sans http:// or https://
var pseudoUrlPattern = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
// Email addresses
View ionic-validation.js
/*
data-req="true"
data-validation="date/cpf/email/placa"
data-eq-value=""
*/
function vform(id) {
var obj = {
status: true,
validation: {}
};
View alertservice.js
'use strict';
/**
* @ngdoc function
* @name app.service:API
* @description
* # API
*/
angular.module('app').service('Alerts', function($ionicLoading, $ionicPopup, $http, $ionicHistory, $location) {
return {
@jgabriellima
jgabriellima / ArvoreBinaria.java
Created Nov 16, 2016 — forked from leandrogualter/ArvoreBinaria.java
Árvore binária em java adaptando código de um amigo.
View ArvoreBinaria.java
public class ArvoreBinaria {
private No raiz;
private ArvoreBinaria arvoreEsquerda;
private ArvoreBinaria arvoreDireita;
public ArvoreBinaria() { }
public ArvoreBinaria getArvoreDireita() {
return arvoreDireita;
}
View backandService.ts
export enum EVENTS {
SIGNIN,
SIGNOUT,
SIGNUP
};
export const URLS = {
signup: '/1/user/signup',
token: '/token',
requestResetPassword: '/1/user/requestResetPassword',
@jgabriellima
jgabriellima / README.md
Created Feb 14, 2017
imoveis mangueirao-2013
View README.md

README is empty