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 / aux-termoo.js
Created October 3, 2022 14:03
aux-termoo
function getPalavras() {
listaPalavras = `sagaz
âmago
negro
êxito
mexer
termo
senso
nobre
algoz
@viniceosm
viniceosm / utilidade-php.md
Last active August 25, 2022 11:10
coisas uteis praticas

1

Separar por vírgula cada item e cada item ficar entre aspas simples

$codigoProduto = array("maçã", "banana");
$codigoProdutoStr = sprintf("'%s'", implode("','", $codigoProduto));
// 'maçã','banana'

Criar uma task para executar script php

Usar algum editor de texto para abrir o /etc/crontab, por exemplo:

sudo vi /etc/crontab

Exemplo crontab

@viniceosm
viniceosm / popprogramas.sh
Last active August 17, 2021 12:50
pop os programas.sh
#!/usr/bin/env bash
sudo apt -y install git
# sublime
# baixar deb https://download.sublimetext.com/sublime-text_build-3211_amd64.deb
# snap
sudo apt install snapd
#!/bin/bash
pid_discord_hex=$(wmctrl -l | grep -i discord | awk '{print $1}');
wmctrl -a $pid_discord_hex -i;
xdotool mousemove 97 1053; # btn icon, abre opcoes de status
xdotool click 1;
sleep 1
xdotool mousemove 207 1003; # btn custom status

Artistas que eu gosto

Trap tipo 1

  • Beam
  • Don Toliver
  • Travis Scott
  • Yunk Vino

Jazz

  • Lisa Ekdahl

Função JS

function maskVini() {
    var inputsMascara = document.querySelectorAll('[mask-vini]');
    
    inputsMascara.forEach((inputMascara) => {
        inputMascara.addEventListener('input', (event) => {
            var padraoMascara = inputMascara.getAttribute('mask-vini');
            mask(inputMascara, padraoMascara, event);
@viniceosm
viniceosm / order-multi-keys.md
Created March 24, 2020 21:51
Order array by multiple keys

Exemplo

var homes = [
	{ city: 'A', price: 2, id: 0 },
	{ city: 'A', price: 3, id: 2 },
	{ city: 'A', price: 3, id: 1 },
	{ city: 'A', price: 2, id: 5 },
	{ city: 'B', price: 1, id: 6 },
	{ city: 'B', price: 1, id: 0 }
@viniceosm
viniceosm / cbToPromise.html
Created January 24, 2020 19:19
in working....
<html>
<script>
var Pessoa = {
pesquisa: function (arg1, callback) {
callback([
{
nome: 'Vinícius'
},
{
nome: 'Amanda'
@viniceosm
viniceosm / permute.py
Created January 10, 2020 12:34
permute
def permute(xs, low=0):
if low + 1 >= len(xs):
yield xs
else:
for p in permute(xs, low + 1):
yield p
for i in range(low + 1, len(xs)):
xs[low], xs[i] = xs[i], xs[low]
for p in permute(xs, low + 1):
yield p