Skip to content

Instantly share code, notes, and snippets.

View aod7br's full-sized avatar

Andre Dias aod7br

  • EnCirca
  • Rio de Janeiro
  • 19:39 (UTC -03:00)
  • LinkedIn in/andre-dias
View GitHub Profile
@aod7br
aod7br / combine-repos-into-mono-repo.md
Created May 30, 2024 23:29 — forked from acg/combine-repos-into-mono-repo.md
How to combine two git repos into a monorepo without `git merge`

Use Case

Suppose you have local checkouts of two git repositories, a and b. You'd like to combine them into a new git repo c ("the monorepo"). More specifically, you'd like to:

  1. Preserve the combined commit history.
  2. Keep the commits from a and b ordered chronologically in c, interleaving as necessary.
  3. Avoid new merge commits, because you're a rebase-only freak like me. Most answers on the internet use git merge.
  4. Ignore all branches of a and b other than master. It's possible to port them over, but would significantly complicate these instructions. So for now that's an exercise left for the reader.

Preliminaries

@aod7br
aod7br / debug.py
Last active July 31, 2023 13:57
combine debug, logging and exception handling in one @decorator
import logging
logging.basicConfig(level=logging.DEBUG)
def debug(func):
'''
@debug
def f(a,b,c=0):
raise Exception("Crashing")
return a+b+c
'''
Bluetooth/Pyjnius example
=========================
This was used to send some bytes to an arduino via bluetooth.
The app must have BLUETOOTH and BLUETOOTH_ADMIN permissions (well, i didn't
tested without BLUETOOTH_ADMIN, maybe it works.)
Connect your device to your phone, via the bluetooth menu. After the
pairing is done, you'll be able to use it in the app.
@aod7br
aod7br / gist:8944913
Created February 11, 2014 21:51
ipython notebook - superformula
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{