Skip to content

Instantly share code, notes, and snippets.

View davividal's full-sized avatar

Davi Koscianski Vidal davividal

View GitHub Profile
@felipecwb
felipecwb / pascalTree.js
Last active September 15, 2016 12:23
Arvore de Pascal in JavaScript
#!/usr/bin/env node
"use strict";
String.PAD_LEFT = 1;
String.PAD_RIGHT = 2;
String.PAD_BOTH = 3;
String.prototype.pad = function(len, pad, dir) {
var str = this;
if (typeof(len) == "undefined") { len = 0; }
if (typeof(pad) == "undefined") { pad = ' '; }
@felipecwb
felipecwb / gitconfig.ini
Last active July 4, 2020 03:51
Some git configs
[user]
name = My name
email = my@email
[alias]
timeline = log --graph --branches --pretty=oneline --decorate --abbrev-commit --all
history = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all --decorate --abbrev-commit
yolo = "!git add -A && git commit -m \"$(curl -s whatthecommit.com/index.txt)\""
@raul
raul / mediahint.js
Last active January 29, 2016 20:12
I like mediahint.com's extension but it relies on this external pac file hosted at https://mediahint.com/default.pac If mediahint.com gets compromised my whole navigation could get proxied without noticing. I'll modify the installed extension (under `~/Library/Application Support/Google/Chrome/Default/Extensions/...` in my Mac) to use a local ve…
function FindProxyForURL(url, host){
var myip = myIpAddress();
var ipbits = myip.split(".");
var myseg = parseInt(ipbits[3]);
if(myseg == Math.floor(myseg/2)*2){
proxy = 'PROXY 165.225.131.153:80; PROXY 165.225.130.193:80';
} else {
proxy = 'PROXY 165.225.130.193:80; PROXY 165.225.131.153:80';
}
if((host == 'localhost')||(shExpMatch(host, 'localhost.*'))||(shExpMatch(host, '*.local'))||(host == '127.0.0.1')){