Skip to content

Instantly share code, notes, and snippets.

@ndvo
ndvo / fixjava.sh
Created June 6, 2019 13:15
Fix display of Java application under DWM
wmname LG3D
export hoje=`date +%Y-%m-%d`
sudo update-alternatives --config java
snx -s 000.000.000.000 -u nelson@domain.com
setxkbmap -layout br -variant nativo
source ~/scripts/android.sh
nvm use node
sudo update-alternatives --config java
export JAVA_HOME=$(update-alternatives --query javac | sed -n -e 's/Best: *\(.*\)\/bin\/javac/\1/p')
export J2REDIR=''
export J2SDKDIR=''
source ~/scripts/fixjava.sh
@ndvo
ndvo / newbug
Created June 6, 2019 13:20
Create a text file for a bug using vim
#!/bin/bash
hoje=`date +%Y-%m-%d`
LAST=$(find . -maxdepth 1 -name $hoje-"*.bug" -type f -printf "%p\n" | sed -e s/.\\/$hoje-//g -e s/.bug//g | sort -g | tail -1)
echo $hoje-$(($LAST + 1)).bug
vim $(newbug)
@ndvo
ndvo / challengeTableFilter.js
Created August 8, 2019 20:03
A js filter manipulating DOM (answer to an exercise)
console.log("Initializing mySearch");
var filter=document.getElementById('myfilter')
buildForm(filter, filterTable)
function filterTable(){
this.table.setAttribute('id', 'deu-certo')
@ndvo
ndvo / .vimrc
Last active September 27, 2019 09:31
vimrc
let mapleader = " "
set backupdir=.backup/,~/.backup/,/tmp//
set directory=.swp/,~/.swp/,/tmp//
set undodir=.undo/,~/.undo/,/tmp//
set undofile
packloadall " Load all plugins.
silent! helptags ALL " Load help files for all plugins.