Skip to content

Instantly share code, notes, and snippets.

View viniceosm's full-sized avatar

Vinícius Miiller Rebello viniceosm

View GitHub Profile
@viniceosm
viniceosm / criarLinkSimbolico.md
Last active October 26, 2018 11:52
criar link simbolico para arrumar problema do libpcre16.so.3 no tibia
@viniceosm
viniceosm / possibilidadesIf.js
Last active February 16, 2018 16:40
Montar as possibilidades através de if/else
class PossibilidadesIf {
constructor() {
this.arrSe = [];
this.syntaxesComParametro = ['se', 'senao', 'log', 'getMensagem'];
this.syntaxesSemParametro = ['fimse'];
}
se(str) {
this.arrSe.push(str);
}
senao(str) {
@viniceosm
viniceosm / comandosGit.md
Last active June 12, 2019 11:45
comando git

Ver histórico de alterações de arquivo

git log -p filename

Ver arquivos commit

git log --name-only
@viniceosm
viniceosm / zypper.md
Last active March 15, 2018 12:31
Comandos do Zypper, o gerenciador de pacotes.

Comandos

Aplicar todos os patches necessários ao sistema sem solicitar confirmação de nenhuma licença

zypper patch --auto-agree-with-licenses

Testar comandos zypper

zypper remove --dry-run MozillaFirefox
@viniceosm
viniceosm / git-change-commit-messages.md
Created March 19, 2018 10:31 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@viniceosm
viniceosm / vkek.js
Last active March 21, 2018 19:54
vkek - manipular o DOM
function Vkek(){
// this.el será o elemento buscado apartir do Vkek.$()
}
Vkek.prototype = {
$: function(selector) {
if (typeof selector == 'string') {
this.el = (document.querySelectorAll(selector).length > 1) ? document.querySelectorAll(selector) : document.querySelector(selector);
} else {
this.el = selector;
@viniceosm
viniceosm / promiseCont.js
Created April 6, 2018 12:26
Exemplo de promise com async function
function promiseCont(cont = 0){
return new Promise((resolve, reject) => {
resolve(cont + 1);
})
}
async function contadorSincrono() {
try {
r = await promiseCont();
console.log(r);
function Recjs(usuarios, itens, interacao) {
Object.assign(this, { usuarios, itens, interacao });
}
Recjs.prototype.getAllUsuarios = function() {
return this.usuarios;
}
Recjs.prototype.recomendarPara = function(usuario) {
var filtradoApartirAmigos = filtrarPorAmigos(usuario); //interacao filtrada
@viniceosm
viniceosm / regexIncludeExclude.md
Last active June 28, 2018 03:33
regex include and exclude

two pattern

let validate = (str) => {
	let required = /(\$.*\$)/i; // Regex include - tem que te-lo
	let blocked = /(\$\()/i; // Regex exclude - não tem que te-lo
	return required.test(str) && !blocked.test(str);
}

one pattern

@viniceosm
viniceosm / listaSimplesEncadeada.c
Last active June 3, 2018 20:00
Inserir no inicio, no final, imprimir lista, remover da lista ou esvaziar lista
#include <stdio.h>
#include <locale.h>
//Definindo da lista simplesmente encadeada
typedef struct lista {
int num;
struct lista *prox;
} LISTA;