Skip to content

Instantly share code, notes, and snippets.

View rgcs88's full-sized avatar

Rafael "Brodinho" Guimarães rgcs88

View GitHub Profile
@paulopatto
paulopatto / README.md
Last active August 28, 2024 00:31
Converter taxa de cambio entre Moedas com Google SpreadSheet

Cotação de moedas com Planilhas do Google SpreadSheet

Hoje enquanto eu tentava criar minha calculadora de importação de produtos (com tributos, Taxa ilegal de processamento de encomendas internacionais e IOF). Com isso precisava de dados de conversão autmática de valores em Dollar americano para o Real brasileiro (USD -> BRL). A melhor solução que encontrei foi efetuar a pesquisa de cotação na url do google finance convert em https://www.google.com/finance/converter?a=1&from=USD&to=BRL. Bem tendo a url que nos retorna um documento HTML vamos pegar o dados com a função IMPORTXML

ImportXML(url; xpath query)

Importa dados de qualquer um dos vários tipos de dados estruturados, incluindo XML, HTML, CSV, TSV e XML de feeds RSS e Atom.

Com isso tenho o resultado como texto, ai tive de converter a planilha para formatação U.S.A para usar ponto como separador decimal e usar a formula de regex [0-9]*\.[0-9]+[0-9]+para extrair apenas o valor numérico. Minha formula completa

@cfxd
cfxd / .htaccess
Last active June 2, 2022 11:53
Deploy WordPress (Bedrock) with Capistrano to a Shared Host (Bluehost). See http://cfxdesign.com/deploy-wordpress-with-capistrano-on-bluehost/
RewriteEngine on
#change dev.example.com to your domain name
RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$
RewriteCond %{REQUEST_URI} !^/current/web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /current/web/$1
#change dev.example.com to your domain name
RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$
RewriteRule ^(/)?$ current/web/index.php [L]
@mattiaslundberg
mattiaslundberg / arch-linux-install
Last active June 8, 2026 14:22
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@magnetikonline
magnetikonline / README.md
Last active December 22, 2021 17:13
Using Dnsmasq with Ubuntu 16.04LTS/14.04LTS/12.04LTS for virtual machine web application testing.

Using Dnsmasq with Ubuntu for VM web application testing

When running virtual machines under a Linux host system for testing web apps in various browsers (e.g. Internet Explorer), I found it rather tedious having to continually tweak the hosts file within each VM for the purpose of adding entries pointing back to the host machine's development web server address.

Instead the steps below will setup Dnsmasq on a Ubuntu 16.04LTS, 14.04LTS or 12.04LTS host machine for the purpose of serving both it's own DNS queries and that of virtual machine guests. Dnsmasq will parse the /etc/hosts file on your host machine where we will keep a single set of DNS entires to our test web application(s).

@jshaw
jshaw / byobuCommands
Last active April 21, 2026 04:59
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@ryansully
ryansully / optimize.sh
Created February 1, 2012 23:56 — forked from realdeprez/optimize.sh
image optimization script (pngcrush & jpegtran)
#!/bin/sh
# script for optimizing images in a directory (recursive)
# pngcrush & jpegtran settings from:
# http://developer.yahoo.com/performance/rules.html#opt_images
# pngcrush
for png in `find $1 -iname "*.png"`; do
echo "crushing $png ..."
pngcrush -rem alla -reduce -brute "$png" temp.png