Skip to content

Instantly share code, notes, and snippets.

View serrasqueiro's full-sized avatar
🎯
Focusing

Henrique serrasqueiro

🎯
Focusing
View GitHub Profile
@serrasqueiro
serrasqueiro / reindent.py
Last active March 26, 2023 10:58 — forked from akanakia/reindentv2.py
A slightly more versatile reindent.py
# reindent.py -- Tim Peters, and H.Moreira
# pylint: disable=missing-function-docstring, trailing-whitespace, line-too-long, invalid-name, unused-argument
# Re-named to reindent.py and enhanced by Henrique Moreira, 01 Dec 2019.
# Released to the public domain, by Anshul Kanakia, 22 May 2019 as reindentv2.py
# Original code reindent.py released to the public domain, by Tim Peters, 03 October 2000.
# This version is modified to allow custom indent space values (not just 4 spaces).
"""reindent [-d][-r][-v] [ path ... ]
@serrasqueiro
serrasqueiro / perforce.md
Created December 4, 2019 10:55 — forked from martynjarvis/perforce.md
Perforce Cheatsheet

Perforce Cheatsheet

Useful Commands:

Check I have no changes:

p4 opened

Sync to head:

@serrasqueiro
serrasqueiro / delete_git_submodule.md
Last active July 23, 2023 12:03 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  1. Delete the relevant section from the .gitmodules file.
  2. Stage the .gitmodules changes: git add .gitmodules
  3. Delete the relevant section from .git/config
  4. Run git rm --cached path_to_submodule (no trailing slash)
  5. Run rm -rf .git/modules/path_to_submodule (no trailing slash)
  6. Commit: git commit -m "Removed submodule <name>"
  7. Delete the now untracked submodule files: rm -rf path_to_submodule
@serrasqueiro
serrasqueiro / README.md
Last active June 4, 2023 13:54 — forked from cookedapple/l2h
convert unicode chars to html (incomplete)
  • Introduction 'another_4433185' gathers different ways of dumping latin-1 chars (such as accented letters) from UniCode 0..255 into straight 7bit/ HTML strings.

  • Original author This was originally fetched from cookedapple It was a very basic function (see 'l2h').

  • Content ** Files:

@serrasqueiro
serrasqueiro / ls_colors
Created July 4, 2021 16:27 — forked from jmoz/ls_colors
ls_colors file to change colour of ls
# di=5;34;43 Setting the LS_COLORS di parameter to the above example will make directories appear in flashing blue text with an orange background
#0 = Default Colour
#1 = Bold
#4 = Underlined
#5 = Flashing Text
#7 = Reverse Field
#31 = Red
#32 = Green
#33 = Orange
#34 = Blue
@serrasqueiro
serrasqueiro / states_hash.json
Created July 10, 2021 13:19 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@serrasqueiro
serrasqueiro / markdown_doc.py
Last active August 20, 2022 10:42 — forked from jiffyclub/markdown_doc
This script turns Markdown into HTML using the Python markdown library and wraps the result in a complete HTML document with default Bootstrap styling so that it's immediately printable. Requires the python libraries jinja2, markdown, and mdx_smartypants.
#!/usr/bin/env python
import argparse
import sys
import jinja2
import markdown
TEMPLATE = """<!DOCTYPE html>
<html>
@serrasqueiro
serrasqueiro / examples.md
Last active October 23, 2022 12:01 — forked from PurpleBooth/examples.md
Tracing Example

Distributed Tracing: From Chaos to Clarity

Supporting Material.

The Slides

Live Example