Skip to content

Instantly share code, notes, and snippets.

View enapupe's full-sized avatar

Iacami Gevaerd enapupe

View GitHub Profile
@enapupe
enapupe / notification.css
Created August 29, 2014 13:24
AngularJS Notification Service
.notifications-service {
position: fixed;
top: 10px;
width: 100%;
text-align: center;
}
.notification-list {
list-style: none;
padding: 0;
margin: 0;
@enapupe
enapupe / autogrow.js
Last active February 8, 2021 11:26
Auto Grow/Shrink textarea directive for AngularJS (credits to this gist https://gist.github.com/thomseddon/4703968, specially @huyttq)
angular.module("myApp").directive("autoGrow", function(){
return function(scope, element, attr){
var update = function(){
element.css("height", "auto");
var height = element[0].scrollHeight;
if(height > 0){
element.css("height", height + "px");
}
};
scope.$watch(attr.ngModel, function(){
<?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";
'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,
//A less clean solution, is to change the syntax of the AngularJS template tags. Just add the following statement during module instantiation:
var my_app = angular.module('MyApp').config(function($interpolateProvider) {
$interpolateProvider.startSymbol('{$');
$interpolateProvider.endSymbol('$}');
});
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
int menu();
void imprimeConcurso();
void carregaConcurso();
void test();
#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]);
<?php
function validar_cnpj($cnpj)
{
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj);
// Valida tamanho
if (strlen($cnpj) != 14)
return false;
@enapupe
enapupe / GAnalytics.php
Last active March 14, 2019 13:45
Google Analytics API interface for Code Igniter
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* GAnalytics - Google Analytics PHP Interface for Code Igniter
* Uses google php api https://github.com/google/google-api-php-client
*
* Support material:
* How to set-up the app and configure the analytics profile http://stackoverflow.com/a/10089698/1666071
* Analytics query explorer http://ga-dev-tools.appspot.com/explorer/
*
@enapupe
enapupe / functions.php
Created September 26, 2013 13:36
functions.
<?php
ob_settings_config {
var $group = "enapupe"; // defines setting groups (should be bespoke to your settings)
var $page_name = "enapupe"; // defines which pages settings will appear on. Either bespoke or media/discussion/reading etc
var $title = "Detrick"; // page title that is displayed
var $nav_title = "Detrick"; // how page is listed on left-hand Settings panel
var $sections = array(