This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function validar_cnpj($cnpj) | |
{ | |
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj); | |
// Valida tamanho | |
if (strlen($cnpj) != 14) | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(){ | |
int max=3, i=0, j=0, k=0, l=max; | |
int x[max], y[max], z[max+max]; | |
printf("Digite os valores para o array X\n"); | |
for(i=0; i<max; i++){ | |
scanf("%d", &x[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <ctype.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int menu(); | |
void imprimeConcurso(); | |
void carregaConcurso(); | |
void test(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var gulp = require('gulp'); | |
var imacss = require('gulp-imacss'); | |
var imagemin = require('gulp-imagemin'); | |
var pngcrush = require('imagemin-pngcrush'); | |
gulp.task('imacss', function () { | |
gulp.src('app/images/sprites/**/*.svg') | |
.pipe(imagemin({ | |
progressive: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function clean_da_svg($svg){ | |
$remover[] = 'xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"'; | |
$remover[] = 'xmlns:xlink="http://www.w3.org/1999/xlink"'; | |
$remover[] = 'x="0px" y="0px"'; | |
$remover[] = '<defs></defs>'; | |
$remover[] = 'version="1.1"'; | |
$remover[] = "\r"; | |
$remover[] = "\n"; | |
$remover[] = "\r\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.notifications-service { | |
position: fixed; | |
top: 10px; | |
width: 100%; | |
text-align: center; | |
} | |
.notification-list { | |
list-style: none; | |
padding: 0; | |
margin: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myApp.directive("focusMe", function($timeout){ | |
return { | |
restrict: "A", | |
link: function(scope, element, attrs){ | |
scope.$watch(attrs.focusMe, function(value){ | |
if(value === true){ | |
$timeout(function(){ | |
element[0].focus(); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module("myApp").directive("form", function(){ | |
return { | |
require: "^form", | |
link: function(scope, elem, attr, ctrl){ | |
elem.on("reset", function(){ | |
ctrl.$setPristine(); | |
}); | |
} | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module("myApp").directive("theTooltip", function($timeout, $sce){ | |
return { | |
restrict: "E", | |
template: "<tooltip-arrow arrow-top></tooltip-arrow><tooltip-content ng-bind-html=\"content\"></tooltip-content><tooltip-arrow></tooltip-arrow>", | |
link: function(scope, elem, attr){ | |
scope.$on("tooltip.show", function(undefined, newval){ | |
elem.css("visibility", "hidden"); | |
scope.content = $sce.trustAsHtml(newval.content); | |
// aplicamos o escopo para forçar a renderizacao do novo content | |
// no tooltip, e assim poder calcular o novo tamanho no próximo |
OlderNewer