Skip to content

Instantly share code, notes, and snippets.

View walbinjr's full-sized avatar

Walter Jr. walbinjr

  • Claro S/A
  • Mogi das Cruzes, Brazil
  • 09:05 (UTC -03:00)
  • LinkedIn in/walbinjr
View GitHub Profile
@walbinjr
walbinjr / .vimrc
Created January 24, 2018 15:43
vim helper
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@walbinjr
walbinjr / .angular-cli.json
Created November 13, 2017 17:27
Medium - angular cli json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "overtime-ng"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
@walbinjr
walbinjr / manifest.json
Created November 13, 2017 16:34
Medium - manifest service worker
{
"short_name": "Time to Go",
"name": "Time To Go!",
"start_url": "index.html?launcher=true",
"icons": [
{
"src": "assets/icon.png",
"type": "image/png",
"sizes": "128x128"
}
@walbinjr
walbinjr / manifest.json
Created November 13, 2017 16:33
Medium - manifest chrome
{
"manifest_version": 2,
"name": "Time to go!",
"description": "Calcule a hora de ir embora!",
"version": "4.0",
"icons": {
"16": "assets/icon.png",
"48": "assets/icon.png",
"128": "assets/icon.png"
},
@walbinjr
walbinjr / my.pac
Last active November 6, 2017 17:40
function FindProxyForURL(url, host) {
var proxy = "PROXY walbinjr.ddns.net:8118; DIRECT";
var direct = "DIRECT";
// no proxy for local hosts without domain:
if(isPlainHostName(host)) return direct;
//We only cache http
if (
url.substring(0, 4) == "ftp:" ||
@walbinjr
walbinjr / .gitconfig
Last active January 2, 2020 10:38
Alias gitconfig
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lgg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --numstat
lgm = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --no-merges
st = status
co = checkout
cm = "commit -m "
all = "!f(){ git add . && git commit -m \"$1\"; git push origin; };f"
p = pull
g = grep --break --heading --line-number
@walbinjr
walbinjr / random.js
Created May 20, 2017 13:23
random select with rates
// https://jsfiddle.net/c7584nqt/2/
function isFair(player1, player2) {
let sum = player1.rate + player2.rate;
if (sum == 4 || sum == 1) {
return false;
}
return true;
}
@walbinjr
walbinjr / mongo-repair.sh
Last active January 2, 2018 17:11
Fixing MongoDB against unclean shutdown
# Execute with sudo
grep -i dbpath /etc/mongod.conf
# dbpath=/var/lib/mongodb
rm /var/lib/mongodb/mongod.lock
mongod --repair --dbpath /var/lib/mongodb
chown -R mongodb:mongodb /var/lib/mongodb
service mongod restart
@walbinjr
walbinjr / walbinjr.zsh-theme
Created February 3, 2017 14:32
Oh-my-zsh Theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
PROMPT=$'${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%~ %{$fg_bold[blue]%}rb:(%{$fg_bold[yellow]%}$(current_ruby)%{$fg_bold[blue]%}) %{$fg_bold[blue]%}n:(%{$fg_bold[yellow]%}$(nvm_prompt_info)%{$fg_bold[blue]%}) $(git_prompt_info)\
%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
@walbinjr
walbinjr / MainController.java
Created December 4, 2014 12:36
Controller Sample
public class MainController implements RequestInterceptor {
private FragmentActivity activity;
private SocialNetworkLogin login = null;
private RestAdapter restAdapter;
private NovasMediasAPI novasMediasAPI;
private Map<String, String> params = new HashMap<String, String>();
private SessionManager session;
public MainController(FragmentActivity activity) {