Skip to content

Instantly share code, notes, and snippets.


Érico Vieira Porto ericoporto

View GitHub Profile
ericoporto /
Last active Nov 1, 2019 — forked from bradmontgomery/
A minimal http server and client pair. It's intended to show how to communicate between a server and a client in Python.
#!/usr/bin/env python
Very simple HTTP server and client pair in python.
Server based on:
./ start [<port>]
Send a message (on a second terminal) ::
./ notify "hello world!"
ericoporto / buttonmakerifttt.ino
Last active Aug 28, 2015 — forked from outofmbufs/iftttmaker.ino
A button to the Internet! Code to a button in an Arduino trigger an IFTTT/Maker event. Moved to here:
View buttonmakerifttt.ino
// This code makes a button connect on pin 2 of the Ethernet Shield
// connected to an Arduino trigger a event named button_pressed on
// the IFTTT Maker Channel. Based on the Neil Webber analog read code.
// The MIT License
// Copyright (c) 2015 Erico Porto
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
ericoporto / github-to-bitbucket
Created Feb 10, 2018 — forked from sangeeths/github-to-bitbucket
Forking a Github repo to Bitbucket
View github-to-bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: (for ssh) or (for https).

You make edits, and commit and push your changes, like any normal repo.

How do I add images to a wiki page?

You need to clone the wiki repo and edit it on your system.

ericoporto / Generate Normal Map.lua
Created Mar 10, 2019 — forked from ruccho/Generate Normal Map.lua
Lua script for Aseprite that generates normal map automatically.
View Generate Normal Map.lua
-- Generate Normal Map
-- It works only for RGB color mode.
if app.apiVersion < 1 then
return app.alert("This script requires Aseprite v1.2.10-beta3")
View gist:1eb5f65d733233daef0184971bd3c6a9
#! /usr/bin/python2
# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
class FlowLayout(QtGui.QLayout):
def __init__(self, parent=None, margin=0, spacing=-1):
super(FlowLayout, self).__init__(parent)
if parent is not None:
ericoporto / ImGuiUtils.h
Created Jan 6, 2020 — forked from dougbinks/ImGuiUtils.h
ImGuiUtils.h with TextURL
View ImGuiUtils.h
#pragma once
#include "RuntimeImGui.h"
#include "RuntimeInclude.h"
#include "IconsFontAwesome.h" // from
#include "PlatformUtils.h"
namespace ImGui
ericoporto /
Last active Feb 7, 2020 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

Note: I use ssh keys with git instead of https.

1. Clone your fork:

git clone

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream
ericoporto /
Created Jun 26, 2020 — forked from Aerijo/
Guide to writing an Atom language grammar

A guide to writing a language grammar (TextMate) in Atom

Tree sitter

  • Atom is transitioning to an entirely new way of defining grammars using tree-sitter. This will be enabled by default quite soon now. It is theoretically faster and more powerful than regex based grammars (the one described in this guide), but requires a steeper learning curve. My understanding is that regex based grammars will still be supported however (at least until version 2), so this guide can still be useful. To enable it yourself, go to Settings -> Core and check Use Tree Sitter Parsers

Links for tree-sitter help:

ericoporto /
Created Oct 19, 2020 — forked from WesThorburn/
Linux: Compile C++ to WebAssembly and JavaScript using Emscripten and CMake

Linux: Compile C++ to WebAssembly and JavaScript using Emscripten and CMake

Download and Install Emscripten

  • My preferred installation location is /home/user
  • Get the latest sdk: git clone
  • Enter the cloned directory: cd emsdk
  • Install the lastest sdk tools: ./emsdk install latest
  • Activate the latest sdk tools: ./emsdk activate latest
  • Activate path variables: source ./
  • Configure emsdk in your bash profile by running: echo 'source "/home/user/emsdk/"' >> $HOME/.bash_profile