Skip to content

Instantly share code, notes, and snippets.

Avatar
🎮
making

Érico Vieira Porto ericoporto

🎮
making
View GitHub Profile
@ericoporto
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: https://github.com/ericoporto/IFTTTButton
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
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 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
View github-wiki-how-to.md

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.

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
ericoporto / server-http.py
Last active Nov 1, 2019 — 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.
View server-http.py
#!/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 / 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"
RUNTIME_MODIFIABLE_INCLUDE;
#include "IconsFontAwesome.h" // from https://github.com/juliettef/IconFontCppHeaders
#include "PlatformUtils.h"
namespace ImGui
@ericoporto
ericoporto / keepingForkUpToDate.md
Last active Feb 7, 2020 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date
View keepingForkUpToDate.md

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 Jun 26, 2020 — forked from Aerijo/making_language_grammar.md
Guide to writing an Atom language grammar
View making_language_grammar.md

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 Oct 19, 2020 — forked from WesThorburn/1.Instructions.md
Linux: Compile C++ to WebAssembly and JavaScript using Emscripten and CMake
View 1.Instructions.md

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
@ericoporto
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")
end
You can’t perform that action at this time.