Skip to content

Instantly share code, notes, and snippets.

View tavinus's full-sized avatar

Gustavo Arnosti Neves tavinus

View GitHub Profile
@tavinus
tavinus / upgrade-nghttp2
Created April 3, 2020 23:25 — forked from noplanman/upgrade-nghttp2
Upgrade nghttp2 for brew with a fix for older MacOS versions
#!/usr/bin/env bash
# Update brew repo.
printf "%s" "Updating brew repo..."
brew update &> /dev/null
echo "✅"
# Get the currently installed and new version of nghttp2.
printf "%s" "Fetch installed and stable nghttp2 versions..."
VERSION_INSTALLED="$(brew list --versions | grep nghttp2 | awk '{print $2}')"
@tavinus
tavinus / .gitignore
Created March 16, 2020 18:54
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@tavinus
tavinus / grab-html-source.js
Created September 30, 2018 06:58 — forked from iwek/grab-html-source.js
grab html source in casperjs or phantomjs
//phantomjs
var page = require('webpage').create();
var url = 'http://instagram.com/';
page.open(url, function (status) {
var js = page.evaluate(function () {
return document;
});
console.log(js.all[0].outerHTML);
phantom.exit();
@tavinus
tavinus / gist:faef5d04516e8df266bee375fb9c4369
Created September 26, 2018 06:36 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
@tavinus
tavinus / ttf-vista-fonts-installer.sh
Last active October 7, 2021 08:43 — forked from maxwelleite/ttf-vista-fonts-installer.sh
Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Changes: Gustavo Neves
# Website: http://needforbits.wordpress.com/
# Description: Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros
# Microsoft added a group of new "ClearType Fonts" to Windows with Windows Vista and Office 2007.
# These fonts are named Constantia, Corbel, Calibri, Cambria (and Cambria Math), Candara, and Consolas.
# Calibri became the default font on Microsoft Word 2007, and it’s still the default font on Word 2016 today.
# Dependencies: wget, fontforge and cabextract
# Tested: Ubuntu Saucy/Trusty/Xenial
@tavinus
tavinus / README.md
Created February 21, 2017 09:13 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@tavinus
tavinus / install-gm-w-librvg.sh
Last active October 24, 2019 16:30 — forked from whyvez/install-gm-w-librvg.sh
Installs ImageMagick --with-librsvg on Amazon Linux
# With this I was able to successfuly install everything
# on a x86 (32-bit) instance of Amazon Linux.
#
# You should probably not run this script
# It is a much better idea to use this as an Install guide
# Just follow it down, use your tab and be happy
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig
export PATH=/usr/bin:$PATH
export LDFLAGS=-L/usr/lib64:/usr/lib