Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View TiagoDanin's full-sized avatar
🎯
Focusing

Tiago Danin TiagoDanin

🎯
Focusing
View GitHub Profile
@TiagoDanin
TiagoDanin / run.bash
Created August 14, 2023 19:14
Install WSL Ubuntu 22 + Elixir
# Configurations
WINDOWS_USERNAME="tiago"
# END
echo "Installing WSL Ubuntu 22"
sudo apt update
const appName = 'App Web'
const companyName = 'D6'
const version = '1.0.0'
const hasSw = (navigator.serviceWorker && navigator.serviceWorker.controller)
const mode = (window.matchMedia('(display-mode: standalone)').matches)
? 'standalone'
: 'web'
const sw = hasSw
? 'sw-on'
@TiagoDanin
TiagoDanin / nodejs.yml
Created December 30, 2019 21:51
Example my Telegraf Bot Running via GitHub Actions
name: Bot running
on: [push]
jobs:
run:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
@TiagoDanin
TiagoDanin / example
Created December 30, 2019 21:04
Github actions example
name: Node.js Package
on: push
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
load fs : 0.389ms
load path : 0.101ms
load array-uniq : 2.768ms
load array-union : 4.911ms
load fs : 0.081ms
load fs : 0.077ms
load path : 0.072ms
load fs : 0.030ms
load ./old.js : 7.852ms
load fs.realpath : 18.000ms
@TiagoDanin
TiagoDanin / bot.py
Created June 18, 2018 21:11
Exemplo de um Echo Bot usando Webhook. LIB: Telepot
import telepot
from telepot.loop import OrderedWebhook
from flask import Flask, request
app = Flask(__name__)
token = ''
#Test used Localtunnel
#Run: lt --port 8000 -s tergvffgs
url = 'https://tergvffgs.localtunnel.me'
@TiagoDanin
TiagoDanin / bot.py
Created April 25, 2018 12:45
Exemplo de um Echo Bot usando Webhook. LIB: Python-telegram-bot
from telegram.ext import CommandHandler, Updater
def echo_cmd(bot, update): #/echo text
update.message.reply_text(update.message.text)
def main():
token = ''
#Test used Localtunnel
#Run: lt --port 8000 -s tergvffgs
url = 'https://tergvffgs.localtunnel.me'
@TiagoDanin
TiagoDanin / index.html
Created February 3, 2018 23:08
Grupo de JavaScript - COD34234
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8" />
<title> Teste JavaScript</title>
<script type="Text/javascript">
function calcular() {
var pontos = 0;
var doc = document.getElementsByName("quiz01");
@TiagoDanin
TiagoDanin / bot43274823.py
Created January 22, 2018 14:44
Exemplo de como editar mensagem usando o pyTelegramBotAPI(Telebot)
import telebot
bot = telebot.TeleBot("")
chat_id = ""
data = bot.send_message(chat_id, "Isso é um texto")
#edit_message_text(self, text, chat_id=None, message_id=None, inline_message_id=None, parse_mode=None, disable_web_page_preview=None, reply_markup=None)
if data:
bot.edit_message_text("Isso é um novo texto", data.chat.id, data.message_id)
@TiagoDanin
TiagoDanin / FixW10.reg
Created August 15, 2017 14:14
My fix Windows 10
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack\TestHooks]
"Disabled"=dword:00000001
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\DataCollection]
"AllowTelemetry"=dword:00000000
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\DataCollection]
"AllowTelemetry"=dword:00000000