Skip to content

Instantly share code, notes, and snippets.

View guilhermegregio's full-sized avatar

Guilherme Gregio guilhermegregio

View GitHub Profile

Keybase proof

I hereby claim:

  • I am guilhermegregio on github.
  • I am guilhermegregio (https://keybase.io/guilhermegregio) on keybase.
  • I have a public key ASDTbDNk8D9bR_UEz-DwhKuC2M0Xy_537eDfSBGQEdJOewo

To claim this, I am signing this object:

{
"pr": [{
"name": "Grace",
"result": "5:33"
}, {
"name": "Isabel",
"result": "6:33"
}]
}
var expToNumber = {
/**
* Used to return only number of string value
*/
parseExpression: function (expression) {
var parts = expression.split('|');
if (parts.length < 2) {
<!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 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']);
@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>
@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);
}
}
}
<!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 / .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 "
@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