Skip to content

Instantly share code, notes, and snippets.

View gagustavo's full-sized avatar
💭
at gitlab

João Silva gagustavo

💭
at gitlab
View GitHub Profile
@prologic
prologic / LearnGoIn5mins.md
Last active June 20, 2024 04:04
Learn Go in ~5mins
@bruno2ms
bruno2ms / toggle_api_google_spreadsheet.gs
Last active February 27, 2018 13:54
Script para preencher planilha de horas com base na API do Toggl
// Acesse o menu na aba da sua Planilha de Jornada de Horas
// Ferramentas > Editor de Script
// Cole e salve este script, o Google provavelmente pedirá permissão de execução do script
// Acesse as configurações do Toggl no endereço https://toggl.com/app/profile
// Copie a sua apiToken
// Substitua aqui as variáveis necessárias
var apiToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxx';
// Para obter os id`s de workspace e clientes, acesse a página reports, selecione o workspace e cliente e aplice o filtro
@ansrivas
ansrivas / encodings.md
Last active March 17, 2022 21:09
Convert iso-8859-1 to utf-8 in python
# convert iso-8859-1 to unicode to utf-8, where `v` is the string in `iso-8859-1` format
v.decode("iso-8859-1").encode("utf-8")

And as a note, this is also some basic rule:

If you have no way of finding out the correct encoding of the file, then try the following encodings, in this order:

utf-8
iso-8859-1 (also known as latin-1)
@christopher-hopper
christopher-hopper / vm-resize-hard-disk.md
Last active April 5, 2022 10:30
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@dergachev
dergachev / README.md
Created October 10, 2012 16:49
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@cowboy
cowboy / stringify.js
Created September 19, 2012 13:45
JavaScript: like JSON.stringify but handles functions, good for creating arbitrary .js objects?
var stringify = function(obj, prop) {
var placeholder = '____PLACEHOLDER____';
var fns = [];
var json = JSON.stringify(obj, function(key, value) {
if (typeof value === 'function') {
fns.push(value);
return placeholder;
}
return value;
}, 2);