Skip to content

Instantly share code, notes, and snippets.

@thpoiani
thpoiani / Gruntfile.js
Created March 25, 2014 03:55
Concat normalize.css in css files using Grunt
/**
* Gruntfile loading external tasks
*
* ./Gruntfile.js
*
* @param grunt
* @author Thiago Poiani <[email protected]>
*/
module.exports = function (grunt) {
'use strict';
@thpoiani
thpoiani / form.html
Created May 8, 2014 04:42
Get object from array inputs - native way to serialize a form
<form>
<label for="name">Name</label>
<input type="text" name="user[name]" id="name">
<label for="email">Email</label>
<input type="email" name="user[email]" id="email">
<label for="description">Description</label>
<textarea name="user[description]" id="description"></textarea>
@thpoiani
thpoiani / ways-to-emulate-a-click-in-a-link-with-JavaScript.html
Last active August 29, 2015 14:04
Ways to emulate a click in a link with JavaScript
@thpoiani
thpoiani / gist:767576f7ca84bac9bb32
Last active July 23, 2017 16:12
Exibir média de notas dos alunos do IFSP através do sistema Aurora
var disciplinas = $('tbody:not(:first) tr'),
aluno = $('.tabelaCabecalhoAluno td:first').text(),
total = 0,
media = 0,
count = 0;
function isAprovado(disciplina) {
return $(disciplina).find(':last').text() === 'Aprovado';
}
options
{
static = false;
LOOKAHEAD = 2;
JDK_VERSION = "1.7";
IGNORE_CASE = false;
ERROR_REPORTING = true;
}
PARSER_BEGIN(AnalisadorLexico)
@thpoiani
thpoiani / docker.sh
Created December 4, 2015 05:40
Docker (Containers com Docker - Daniel Romero - Casa do Código)
# Installation
$ sudo apt-get update
$ sudo apt-get install build-essential python-software-properties git
$ sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
$ sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update && apt-get install docker
# Hello, Docker
#!/bin/sh
git log --pretty=format:user:%aN%n%ct --reverse --raw --encoding=UTF-8 --no-renames --no-merges > gource-git.log
gource \
-1280x720 \
--seconds-per-day 1.5 \
--auto-skip-seconds 0.5 \
--multi-sampling \
--stop-at-end \
--highlight-users \
@thpoiani
thpoiani / FeatureOfInterest.java
Created May 19, 2016 02:20
52North SOS - GetObservationById to POJO
public class FeatureOfInterest {
private Identifier identifier;
private Geometry geometry;
public Identifier getIdentifier() {
return identifier;
}
public void setIdentifier(Identifier identifier) {
this.identifier = identifier;
@thpoiani
thpoiani / Dockerfile
Last active August 30, 2016 19:17
Dockerfile for VanguardaBrasil applications
# docker build --rm -t vanguarda/project -f Dockerfile
FROM vanguarda/lamp
MAINTAINER Thiago Henrique Poiani <[email protected]>
# copy project
COPY app /var/www/html/app
RUN mkdir /var/www/html/app/log /var/www/html/app/cache -p \
&& touch /var/www/html/app/log/admin.log /var/www/html/app/log/www.log \
&& chmod 777 /var/www/html/app/log -R
@thpoiani
thpoiani / git.sh
Created July 17, 2016 16:46
Git Submodules
# git submodule add MODULE module
# git config --global diff.submodule log
git clone SUBMODULE
git submodule init
git submodule update
# or
git clone --recursive MODULE
git submodule update --remote