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 / filterKeysES10.js
Last active December 16, 2019 14:17
filterKeys ES10
const filterKeys = (_raw, ..._allowed) => {
_allowed = _allowed.flat();
_raws = [_raw].flat();
const filtered = _raws.map(_raw => {
const filtered = Object.keys(_raw)
.filter(key => _allowed.includes(key))
.reduce((obj, key) => {
obj[key] = _raw[key];
return obj;

pra verificar o NUMERO do pendrive, ex: sd1

sudo fdisk -l

1

x=NUMERO

sudo dd if=/dev/zero of=/dev/sd${X} bs=512 count=1 && sync
sudo cfdisk /dev/sd${X}
@viniceosm
viniceosm / destructingObjects.md
Created November 25, 2019 13:55
aqui tem como renomear uma key. Ex: let { nome:nomevini } = p;

Destructing objects

Usando var, let ou const

Obter uma key

let pessoa = { nome: 'vinicius', idade: 21 };
let { nome } = pessoa;

controlFine

requisitos

  • set saldo atual
  • add gastos mensais
  • edit gastos mensais (editar pois pode ter mudado ou alguns deles pode ter variações)
  • set salario
  • edit salario (para editar o salario recebido no mes, pois pode ter alterado/desconto xD)
  • add outros gastos
@viniceosm
viniceosm / aTextWithBorder.html
Created November 21, 2019 03:21
um texto com borda com fundo verde
<html>
<style>
body {
font-family: Impact;
background: greenyellow;
padding: 40px;
}
.c {
text-align: center;
color: white;
@viniceosm
viniceosm / rotategifimage.py
Created November 21, 2019 03:18
rotate gif image python
from PIL import Image
name_image = "20181023_115428129.gif"
im1 = Image.open(name_image)
frames = []
for frame in range(0, im1.n_frames):
im1.seek(frame)
im2 = im1.rotate(90, resample=Image.BICUBIC, expand=True)
@viniceosm
viniceosm / xubuntu-apps.sh
Last active November 22, 2019 00:06
instalar apps em Linux xubuntu 5.0.0-23-generic #24~18.04.1-Ubuntu SMP Mon Jul 29 16:12:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
#!/usr/bin/env bash
sudo apt -y upgrade
sudo apt -y update
sudo apt -y install git
sudo apt -y install curl
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt-get -y install -y nodejs
@viniceosm
viniceosm / getBodyRequestJson.asp
Last active November 4, 2019 14:24
pegar JSON de um request em ASP classico
<%
function requestToJsonString()
bytecount = Request.TotalBytes
bytes = Request.BinaryRead(bytecount)
Set stream = Server.CreateObject("ADODB.Stream")
stream.Type = 1 'adTypeBinary
stream.Open()
stream.Write(bytes)
stream.Position = 0
var codigo = '10011000';
function posicaoBitsVerificadores (codigo) {
var maxPosicao = 0, i = 0;
var posicoesBit = [];
do {
maxPosicao = 2 ** i;
posicoesBit.push(maxPosicao);
i++;
@viniceosm
viniceosm / watchDiffAndCp.sh
Created October 9, 2019 13:12
watch diff files and cp
#!/bin/bash
arquivoAlterando="~/dev/app.js";
arquivoAlterar="~/test/app.js";
while true ;do
sIsDiff=$(diff -q ${arquivoAlterando} ${arquivoAlterar});
if [[ $sIsDiff != "" ]] ;then
isDiff=true;