Skip to content

Instantly share code, notes, and snippets.

View FelipeGrijo's full-sized avatar

Felipe Grijó FelipeGrijo

View GitHub Profile
@FelipeGrijo
FelipeGrijo / holdKey.ahk
Created September 25, 2020 14:11
Pressiona tecla por x segundos. AutoHotkey
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
^r::Suspend ; Control + R = pausa
^+r::ExitApp ; Control + Shift + R = fecha
r:: ; R = pressiona letra E pora 1 seg
Send, {e Down}
Sleep, 1000
Send, {e Up}
const SSE = new EventSource('http://localhost:3000');
SSE.onmessage = (event) => {
const obj = JSON.parse(event.data);
console.log(obj);
};
@FelipeGrijo
FelipeGrijo / ytdl.js
Last active September 20, 2020 08:51
youtube-dl promisify nodejs
// https://gist.github.com/FelipeGrijo
// https://www.npmjs.com/package/youtube-dl
const util = require('util');
const youtubedl = require('youtube-dl'); // 3.0.2 -- 2020.09.20
const ytdl = util.promisify(youtubedl);
const videoUrl = 'http://www.youtube.com/watch?v=AQ4MQ_uhBSs'; // url ou id
const getMusic = async (url, formatId = 140) => {
try {
@FelipeGrijo
FelipeGrijo / ssl.md
Created March 12, 2018 21:43
SSL Xampp Windows

Xampp

Crie um arquivo v3.ext dentro da pasta apache (C:\xampp\apache) e cole:

authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
@FelipeGrijo
FelipeGrijo / qnt-id.php
Last active June 26, 2017 06:27
Contar quantidade de ids de um banco de dados usando mysqli
<?php
//https://gist.github.com/FelipeGrijo
$host = 'localhost';//Endereco
$user = 'root';//Usuario
$pass = '';//Senha
$db = 'contas2';//Nome do banco de dados
$mysqli = new mysqli($host,$user,$pass,$db);
$sql="SELECT count(id) AS total FROM usuarios";//usuarios = nome da tabela
//$sql="SELECT count(id) AS total FROM usuarios where ativo='0'";
@FelipeGrijo
FelipeGrijo / VerificarAlteracao.sh
Created June 22, 2017 14:16
Verifica constantemente um arquivo, e envia um alerta via Pushbullet caso tenho sido alterado.
#!/bin/bash
#sudo apt install inotify-tools
#Envia um alerta no PushBullet quando o arquivo for alterado
#https://gist.github.com/FelipeGrijo
while inotifywait -q -e modify LOCAL-DO-ARQUIVO >/dev/null;
do
API="SUA-API"
MSG="$1"
Title="Arquivo-Sincronizado"
curl -u $API: https://api.pushbullet.com/v2/pushes -d type=note -d title="$Title" -d body="$MSG"
@FelipeGrijo
FelipeGrijo / Backup.bat
Last active April 14, 2017 01:12
Salvar PDFs
::https://gist.github.com/FelipeGrijo
xcopy /Y /S /C /G /H "C:\Users\*.pdf" "D:\"
::Mudar diretório
@FelipeGrijo
FelipeGrijo / resource.rc
Last active March 7, 2017 16:47
Ícone
#ifndef _resource_rc
#define _resource_rc
MAINICON ICON "icone.ico"
#endif
@FelipeGrijo
FelipeGrijo / Restaurar pastas do Meu Computador (Este Computador) no Windows 10 64-bits.reg
Created March 6, 2017 15:31
Restaurar pastas do Meu Computador (Este Computador) no Windows 10 - Restore folders from This PC on Windows 10
;https://gist.github.com/FelipeGrijo
Windows Registry Editor Version 5.00
; Restore Desktop To This PC
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}]
; Restore Documents To This PC
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}]
@FelipeGrijo
FelipeGrijo / Remover pastas do Meu Computador (Este Computador) no Windows 10 64-bits.reg
Created March 6, 2017 15:29
Remover pastas do Meu Computador (Este Computador) no Windows 10 - Remove folders from This PC on Windows 10
;https://gist.github.com/FelipeGrijo
Windows Registry Editor Version 5.00
; Remove Desktop From This PC
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}]
; Remove Documents From This PC
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}]