Skip to content

Instantly share code, notes, and snippets.

View theuves's full-sized avatar
👋
Available for hire

Matheus Alves theuves

👋
Available for hire
View GitHub Profile
@theuves
theuves / install-docker.sh
Last active May 7, 2020 15:55
Script to install Docker on Ubuntu.
#!/usr/bin/env bash
sudo apt update -y
sudo apt install docker.io
sudo apt install docker-compose
sudo usermod -aG docker $USER
@theuves
theuves / exemplo.ptal
Created January 1, 2020 20:39
pantanal - uma linguagem para ensinar.
int somar(int a, int b):
ret a + b
int soma <- somar(2, 40)
imprimir(soma)
@theuves
theuves / pantanal.ptal
Last active January 1, 2020 20:26
PantanAL - Linguagem de programação para ensinar.
#
# PantanAL
# Linguagem de programação para ensinar.
#
# Função para somar dois valores.
int somar(int a, int b):
ret a + b
# Registra soma de 2 e 40 na variável 'soma'.
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "echo Hello!"
WshShell.SendKeys "{ENTER}"
@theuves
theuves / template_glpi
Created December 19, 2019 15:11
Template (modelo) para GLPi.
<table style="height: 50px; width: 464px;">
<tbody>
<tr>
<td style="width: 230px;"><strong>Ramal (<em>não obrigatório</em>):</strong></td>
<td style="width: 230px;"> </td>
</tr>
<tr>
<td style="width: 230px;"><strong>TeamViewer (<em>não obrigatório</em>):</strong></td>
<td style="width: 230px;"> </td>
</tr>
@theuves
theuves / cal.js
Last active September 30, 2019 03:08
Array calendar.
function otherMonthDayString(string) {
return `\x1b[36m${string}\x1b[0m`
}
function todayString(string) {
return `\x1b[42m${string}\x1b[0m`
}
function getCalendarArray(year, month) {
@theuves
theuves / qrcode.js
Last active July 20, 2019 00:37
Coming soon...
/**
* A bookmarklet to generate a QR code from the current page URL.
*
* @author Matheus Alves
* @license MIT
*/
(() => {
function getQrCodeUrl(value, size) {
const url = new URL('https://chart.googleapis.com/chart')
@theuves
theuves / mobile-zoom.js
Last active July 14, 2019 16:05
Testing a zoom effect for touchscreen devices.
<style>
.container {
width: 100%;
overflow: hidden;
}
.image {
width: 100%;
/*transform: scale(3);*/
}
</style>
@theuves
theuves / match.js
Created June 29, 2019 23:07
(WIP) Function to search values of an array.
function createRegex(string) {
const regexPrefix = '^';
const regexSuffix = '$';
const regexMain = string.replace(/(.)/g, '($1).*');
const regexContent = `${regexPrefix}${regexMain}${regexSuffix}`;
const regex = RegExp(regexContent, 'g');
return regex;
}
@theuves
theuves / style.css
Last active April 20, 2020 14:02
Remover cabeçalho e rodapé de impressão no Chrome.
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
@media print{
@page {
size: landscape;
margin: 0mm;
}