Skip to content

Instantly share code, notes, and snippets.

View obrodinho's full-sized avatar

Rafael "Brodinho" Guimarães obrodinho

View GitHub Profile
@obrodinho
obrodinho / README.md
Created February 12, 2019 14:56
[Arch] Install TTF Fonts from Windows 10

Micro Intro

Arch is great and its wiki covers most use cases. This is just a reminder that what works and which newbie tricks are required to get and install these fonts.

Read https://wiki.archlinux.org/index.php/Microsoft_fonts.

Fastest way, but NOT VERIFIED

https://github.com/fphoenix88888/ttf-mswin10-arch This package holds all files nedded to install win10 ms fonts. These are just the pacman-cache-install-ready-sort-of-a-files. They are in the form of: ttf-ms-win10-10.0.17763.1-1-any.pkg.tar.xz, and they are the result of a succesful makepkg

@obrodinho
obrodinho / GuavaMapOrTable.java
Created June 3, 2016 18:40
Guava's Table traversal comparison
package br.com.jusbrasil.diarios.parser.producao;
import java.util.Map;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableTable;
import com.google.common.collect.Table;
import org.apache.commons.lang3.StringUtils;
@obrodinho
obrodinho / README.md
Last active May 3, 2020 21:15
Executing simultaneous ajax requests in a chunk-based order. Slicing demand and deferring execution [jQuery][AJAX]

Slincing huge amount of requests in chunks and Deferring jQuery AJAX requests to execute a chunk at time.

Let's say, that you have a ton of ajax requests to do (what's not recomended) and parallelize all requests may turn your server unstable and your screen blocked.

In this gist I document a solution that I used to preserve the server's sake and alleviate page loading.

Scenario

So, we have elements that holds an attribute (data-async-url) that prior this kludgy solution was used by the jquery plugin async-include by Mr. Peter Coles. BTW, Thanks, Peter!

@obrodinho
obrodinho / README.md
Last active December 30, 2016 09:44
dnsdock working on systemd for a dummy guy like me :|

Hey.

If you didin't get the instructions on the git repo of DnsDock, let's take a step back.

Follow these steps to install DNSDock on your Ubuntu machine:

1. Set BIP (bridge ip) for docker0 interface.

It's better to set an address, cause docker can change addresses between versions. We need to edit /lib/systemd/system/docker.service

@obrodinho
obrodinho / README.md
Last active April 17, 2016 17:40 — forked from fjmk/README.md
Howto use dnsdock in Ubuntu 14.04 trusty

Howto use dnsdock in Ubuntu 14.04 trusty

Using dnsdock resolves the problem of the changing IP's of containers. It is much easier to start a named container and use dns on the host to access the container simply by its name.

patch your /etc/ files so NetworkManager's dnsmasq to use the dnsdock nameserver.

sudo su -
cd
wget https://gist.githubusercontent.com/rguimaraens/6b9e57673170dff76ad4/raw/c2e799aca9593fe735d11845606dc9753ff86db7/etc-dnsdock.patch
cd /etc
@obrodinho
obrodinho / README.md
Created February 10, 2016 23:14 — forked from magnetikonline/README.md
Using Dnsmasq with Ubuntu 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 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).