Skip to content

Instantly share code, notes, and snippets.

View ericoporto's full-sized avatar
🎮
making

Érico Porto ericoporto

🎮
making
View GitHub Profile
@ericoporto
ericoporto / server-http.py
Last active November 1, 2019 01:45 — forked from bradmontgomery/dummy-web-server.py
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: https://gist.github.com/bradmontgomery/2219997
Usage::
./server-http.py start [<port>]
Send a message (on a second terminal) ::
./server-http.py notify "hello world!"
@ericoporto
ericoporto / buttonmakerifttt.ino
Last active August 28, 2015 16:14 — 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: https://github.com/ericoporto/IFTTTButton
// 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
ericoporto / github-to-bitbucket
Created February 10, 2018 02:32 — forked from sangeeths/github-to-bitbucket
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
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: git@github.com/myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (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
ericoporto / Generate Normal Map.lua
Created March 10, 2019 02:29 — forked from ruccho/Generate Normal Map.lua
Lua script for Aseprite that generates normal map automatically.
----------------------------------------------------------------------
-- 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")
end
@ericoporto
ericoporto / gist:1eb5f65d733233daef0184971bd3c6a9
Created June 6, 2019 15:55 — forked from Cysu/gist:7461066
Python: PyQt- FlowLayout
#! /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
ericoporto / ImGuiUtils.h
Created January 6, 2020 15:40 — forked from dougbinks/ImGuiUtils.h
ImGuiUtils.h with TextURL
#pragma once
#include "RuntimeImGui.h"
#include "RuntimeInclude.h"
RUNTIME_MODIFIABLE_INCLUDE;
#include "IconsFontAwesome.h" // from https://github.com/juliettef/IconFontCppHeaders
#include "PlatformUtils.h"
namespace ImGui
@ericoporto
ericoporto / keepingForkUpToDate.md
Last active February 7, 2020 21:06 — 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 git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

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

cd into/cloned/fork-repo

git remote add upstream git@github.com:ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git

@ericoporto
ericoporto / making_language_grammar.md
Created June 26, 2020 10:39 — forked from Aerijo/making_language_grammar.md
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
ericoporto / 1.Instructions.md
Created October 19, 2020 02:10 — forked from WesThorburn/1.Instructions.md
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 https://github.com/emscripten-core/emsdk.git
  • 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 ./emsdk_env.sh
  • Configure emsdk in your bash profile by running: echo 'source "/home/user/emsdk/emsdk_env.sh"' >> $HOME/.bash_profile