Skip to content

Instantly share code, notes, and snippets.

View guilhermegregio's full-sized avatar

Guilherme Gregio guilhermegregio

View GitHub Profile
@guilhermegregio
guilhermegregio / Makefile
Created August 2, 2013 17:29
Exemplo de Makefile para projetos com nodejs e mocha
REPORTER = dot
test:
@NODE_ENV=test ./node_modules/.bin/mocha \
--reporter $(REPORTER) \
--ui tdd \
--check-leaks
test-w:
@NODE_ENV=test ./node_modules/.bin/mocha \
@guilhermegregio
guilhermegregio / pom.xml
Created August 2, 2013 17:54
pom.xml básico para projetos java com jUnit.
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>net.gregio</groupId>
<artifactId>NAME</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@guilhermegregio
guilhermegregio / .gitconfig
Last active December 20, 2015 13:49
Meu .gitconfig e .gitignore
[user]
email = guilherme@3gweb.com.br
name = Guilherme Mangabeira Gregio
[alias]
st = status
logger = log --pretty='%an realizou commit em %ad: %s' --graph
[color]
diff = auto
branch = auto
status = auto
@guilhermegregio
guilhermegregio / .bashrc
Created August 2, 2013 18:09
Meu .bashrc do mac
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOR="\[\033[0;0m\]"
PS1="$GREEN\W$NO_COLOR$RED\$(parse_git_branch)$GREEN\$$NO_COLOR "
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
@guilhermegregio
guilhermegregio / overrideMethodJavascript
Created January 21, 2014 18:31
Override Method in Javascript
function addMethod(object, name, fn) {
var old = object[name];
object[name] = function () {
if (fn.length == arguments.length) {
return fn.apply(this, arguments);
} else if (typeof old == 'function') {
return old.apply(this, arguments);
}
}
}
@guilhermegregio
guilhermegregio / .vimrc
Created June 12, 2014 15:52
.vimrc by gregio.net
"......................................................................ARQUIVO
"" Sai fora na marra!
imap <F12> <esc>:wqa!<cr>
map <F12> :wqa!<cr>
" Abreviacoes uteis para sua sanidade mental
cab W w| cab Q q| cab Wq wq| cab wQ wq| cab WQ wq
" Copy e paste
nmap <F3> :set paste<CR>:r !pbpaste<CR>:set nopaste<CR>
imap <F3> <Esc>:set paste<CR>:r !pbpaste<CR>:set nopaste<CR>
var modulePrimary = angular.module('app', ['app.header', 'app.footer', 'app.sidebar', 'app.container']);
var moduleHeader = angular.module('app.header', []);
var moduleFooter = angular.module('app.footer', []);
var moduleSidebar = angular.module('app.sidebar', []);
var moduleContainer = angular.module('app.container', ['app.home', 'app.contact']);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://npmcdn.com/expect/umd/expect.min.js"></script>
</head>
<body>
var expToNumber = {
/**
* Used to return only number of string value
*/
parseExpression: function (expression) {
var parts = expression.split('|');
if (parts.length < 2) {