Skip to content

Instantly share code, notes, and snippets.

View rafaelvieiras's full-sized avatar
🇧🇷
Working from home

Rafael Vieiras rafaelvieiras

🇧🇷
Working from home
View GitHub Profile
  1. MuOnline 3d models uses only JPG and TGA image formats
    Way to fix if you have model with other formats:
    a. Open images in Photoshop, save to JPG if it doesn't have transparency or TGA if it has transparency
    b. Open smd model in text editor and replace all old images names to new images names.

  2. Images names and Bone(Joint) names length must be not more than 31 character
    Way to fix if some of names are longer than 31 character:
    * If image name is longer than 31 character then:
    a. Rename the image name
    b. Open smd model in text editor and replace all image name to new image name

@rafaelvieiras
rafaelvieiras / reboot-nginx.sh
Created July 20, 2023 12:39
Reboot Unraid UI with error off timeout
#!/usr/bin/env bash
pkill -9 nginx
pkillexitstatus=$?
if [ $pkillexitstatus -eq 0 ]; then
echo "pkill exited normally with nginx killed"
elif [ $pkillexitstatus -eq 1]; then
echo "could not find nginx process to kill"
elif [ $pkillexitstatus -eq 2]; then
@rafaelvieiras
rafaelvieiras / generator.ts
Created March 11, 2020 20:17
Color Generator Typescript
// randomColor by David Merfield under the CC0 license
// https://github.com/davidmerfield/randomColor/
export class RandomColor {
constructor() {
this.populateColorDictionary();
}
@rafaelvieiras
rafaelvieiras / app.js
Last active November 14, 2019 21:09
higher order functions, injeção de depedências no JS como o angular 1
const app = {
allDependencies: {
sayMyNameService: function(name) {
console.warn('Seu nome é ', name);
}
},
controller: function(dependencies, callback) {
const scope = this;
dependencies.forEach(function(dependency) {
if (scope.allDependencies[dependency]) {
@rafaelvieiras
rafaelvieiras / corretor-faixa-audio.sh
Created October 5, 2019 21:48
Corretor de Faixa de audio para arquivos MKV, Troca a faixa principal do audio para a segunda faixa de audio
#!/bin/bash
OIFS="$IFS"
IFS=$'\n'
for file in *.mkv
do
echo $file
mkvpropedit "${file}" --edit track:2 --set flag-default=0
mkvpropedit "${file}" --edit track:3 --set flag-default=1
mkvpropedit "${file}" --edit track:4 --set flag-default=0
mkvpropedit "${file}" --edit track:5 --set flag-default=0
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
Plug 'sonph/onehalf', {'rtp': 'vim/'}
Plug 'neomake/neomake'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
Plug 'editorconfig/editorconfig-vim'
# cat << EOF > /dev/null
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local, see README.md
# -- general -------------------------------------------------------------------

Keybase proof

I hereby claim:

  • I am rafaelvieiras on github.
  • I am rafaelvieiras (https://keybase.io/rafaelvieiras) on keybase.
  • I have a public key ASBfcBQpYdIIObMHYcDS9qiNu3XVEBCfQIZN0-YGtofaZwo

To claim this, I am signing this object:

@rafaelvieiras
rafaelvieiras / home-permissions.md
Created August 6, 2016 16:23
Permissão correta para a pasta public_html, subpastas e arquivos

To recursively give directories read&execute privileges: find /path/to/base/dir -type d -exec chmod 755 {} +

To recursively give files read privileges: find /path/to/base/dir -type f -exec chmod 644 {} +

[{"name":"client","color":"Red","position":{"x":100,"y":100},"increment":false,"timestamp":true,"softdelete":true,"column":[{"name":"id","type":"integer","length":"","defaultvalue":"","enumvalue":"","ai":true,"pk":false,"nu":false,"ui":false,"in":false,"un":true,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c142","order":0},{"name":"title","type":"string","length":"200","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":true,"guarded":false,"visible":false,"hidden":false,"colid":"c124","order":1},{"name":"website","type":"string","length":"255","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":true,"ui":false,"in":false,"un":false,"fillable":true,"guarded":false,"visible":false,"hidden":false,"colid":"c150","order":2},{"name":"tel","type":"integer","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":true,"ui":false,"in":false,"un":false,"fillable":true,"guarded":false,"visible":false,"hidden":fa