Skip to content

Instantly share code, notes, and snippets.

View danielmt's full-sized avatar

Daniel Tavares danielmt

  • Crystal Intelligence
  • London, UK
View GitHub Profile
@danielmt
danielmt / bulletproof_arch.md
Last active July 25, 2022 23:48 — forked from craSH/bulletproof_arch.md
Bulletproof Arch - Minimal Clean Install

Bulletproof Arch

These are working notes on the installation of Arch Linux. I've just completed this install on a notebook (@altercation: Lenovo P50. @craSH: Dell XPS 13" 9380) but the setup should work for most laptop/desktop configurations.

Some assumptions/notes:

  1. This isn't a dual boot configuration. I can see some of the appeal and still work in Adobe from time to time, but given the increasing complexity of EFI and the way Windows/MS manhandles the EFI partition during upgrades, I really would recommend steering clear of dual boot. Just my two cents here.
@danielmt
danielmt / jsonpatch-flask-sqlalchemy.py
Last active July 1, 2021 11:41 — forked from mattupstate/example.py
JSON Patch SQLAlchemy models w/ Flask
from dictalchemy import make_class_dictable
from flask import Flask, request, jsonify, json
from flask_sqlalchemy import SQLAlchemy
from jsonpatch import JsonPatch, JsonPatchException
app = Flask(__name__)
app.debug = True
db = SQLAlchemy(app)
make_class_dictable(db.Model)
@danielmt
danielmt / usb_hid_keys.h
Created May 3, 2021 21:53 — forked from MightyPork/usb_hid_keys.h
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/

WiFi

Symptoms

  • WiFi disconnects.
  • Firmware crashes:
    $ dmesg -H
    [...]
    [May14 10:27] ath10k_pci 0000:3a:00.0: firmware crashed! (uuid 5e323599-d1e8-44f2-a614-9c0df1ea5147)
@danielmt
danielmt / smartparens-cheatsheet.md
Created January 30, 2019 16:43 — forked from pvik/smartparens-cheatsheet.md
A Cheatsheet for Emacs Smarparens example configuration

An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.

Traversal

C-M-f sp-forward-sexp
C-M-b sp-backward-sexp
@danielmt
danielmt / commit.py
Last active March 14, 2022 16:49
pygit 2 snippets - most examples assume using a bare repository.
import pygit2
# open existing repository
repo = pygit2.Repository(pygit2.discover_repository('test_repos'))
# check if repos is newly created
if repo.head_is_unborn:
tb = repo.TreeBuilder()
parent = []
else:
@danielmt
danielmt / auto_treebuilder_test.py
Created November 20, 2018 14:41 — forked from uniphil/auto_treebuilder_test.py
pygit2 auto treebuilder
"""
Defines a function `auto_insert` to help with
`pygit2.Repository.TreeBuilder`s.
Just create the top-level `TreeBuilder`, and it will handle all subtree
creation if you give it paths.
"""
import shutil
from tempfile import mkdtemp
@danielmt
danielmt / browserify_for_webpack_users.markdown
Created November 1, 2017 12:59
browserify for webpack users

browserify for webpack users

There's been a strange explosion in misinformation about browserify recently, particularly in comparisons to webpack.

Generally speaking, most of this confusion stems from how webpack is more willing to pull features into its core to ease discoverability while browserify is more likely to push features out to userland instead.

I think that longer-term, separability has more benefits from a maintenance and

Keybase proof

I hereby claim:

  • I am danielmt on github.
  • I am dostioffski (https://keybase.io/dostioffski) on keybase.
  • I have a public key whose fingerprint is CB8C 105D 5240 C374 B311 0F22 8C43 72D9 9C97 CED6

To claim this, I am signing this object:

INFO global: Vagrant version: 1.9.1
INFO global: Ruby version: 2.2.5
INFO global: RubyGems version: 2.4.5.1
INFO global: VAGRANT_OLD_ENV_TMPDIR="/var/folders/dj/7yxj40ss1q9b31563bfz_ls80000gn/T/"
INFO global: VAGRANT_OLD_ENV_PR_BLACK="%{\e[22;30m%}"
INFO global: VAGRANT_OLD_ENV_PR_BOLD_YELLOW="%{\e[01;33m%}"
INFO global: VAGRANT_OLD_ENV_DEFAULT_USER="daniel"
INFO global: VAGRANT_OLD_ENV_NVM_NODEJS_ORG_MIRROR="https://nodejs.org/dist"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_OLD_ENV_TZ="America/Sao_Paulo"