Skip to content

Instantly share code, notes, and snippets.

View waldyrious's full-sized avatar

Waldir Pimenta waldyrious

View GitHub Profile
@waldyrious
waldyrious / minimal.opml
Created January 8, 2024 19:13
Minimal OPML snippet
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<opml version="2.0">
<body>
<outline text="Foo">
<outline text="Bar" _note="Baz"/>
</outline>
</body>
</opml>
@waldyrious
waldyrious / visible-anchors.js
Created December 26, 2022 11:21
Bookmarklet to add visible anchors to section headings
// Inspired by https://attacomsian.com/blog/deep-anchor-links-javascript
// How to use: Create a new browser bookmark with the code below as the URL.
// See https://www.freecodecamp.org/news/what-are-bookmarklets/
// for more background and detailed instructions.
javascript:document.querySelectorAll('h2[id], h3[id], h4[id], h5[id], h6[id]').forEach(heading => {
let anchor = document.createElement('a');
anchor.href = '#' + heading.getAttribute('id');
anchor.innerText = '#';
anchor.style = 'margin-left: 0.3em';
heading.appendChild(anchor);
@waldyrious
waldyrious / Wikidata: normalize exoplanet names.md
Last active October 23, 2021 15:45
Remove "NAME" at the start of exoplanet names
  1. Run the following query (inspired by this one) to get the list of exoplanets (Q44559) whose names start with "NAME":
    SELECT ?qid ?Len
    WHERE
    {
      ?qid wdt:P31 wd:Q44559;
            rdfs:label ?Len;

FILTER (lang(?Len) = "en").

@waldyrious
waldyrious / git-rebase.md
Created July 7, 2021 12:01
tldr-pages format experiment

git rebase

Reapply commits from one branch on top of another branch. Commonly used to "move" an entire branch to another base, creating copies of the commits in the new location. More information: https://git-scm.com/docs/git-rebase.

# Rebase the current branch on top of another specified branch:
git rebase {{new_base_branch}}
@waldyrious
waldyrious / example.http
Created July 2, 2021 16:01
Example .http file (for VSCode rest client extenion
# To use with the [vscode-restclient](https://github.com/Huachao/vscode-restclient) extension
#-------------------------------------------------------------------------------
# Example with JSON data
POST https://api.example.com/address
Content-Type: application/json
{
"foo": "bar",
"baz": "qux"
@waldyrious
waldyrious / map.geojson
Last active October 24, 2020 22:22
Equipamentos culturais em Portugal (sample)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
  • Mouse & keyboard interaction
    • In the main grid overview mode:
      • Cmd+Shift+<: go to character
        • Type the actual character, an alias like "smileface", or "uniXXXX" for the unicode code point
      • Cmd+K: show metrics window
    • In character design mode:
      • Scroll: move
      • Shift+Scroll: move horizontally
      • Shift+Control+Scroll down: zoom in (centered in the screen, not the cursor)
  • Useful menu entries
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@waldyrious
waldyrious / distraction-free-mornings.sh
Created May 30, 2018 14:34
Script to block Internet access during the morning period
#!/bin/sh
# Script to set up rules to implement offline periods
# during which Internet connection is blocked.
# Start or extend sudo session
sudo -v
# Get the local network address subnet, which should be allowed
# https://askubuntu.com/a/872939/23900
@waldyrious
waldyrious / log_entry.m
Last active February 26, 2018 23:36
Matlab/Octave function to produce a formatted log entry
% Return a formatted string that can be added to a log.
% Available log levels and recommended use cases:
% -- TRACE: Leave breadcrumbs of the program flow; provide context.
% Printed in blue.
% -- DEBUG: Expose internal program state, for development or troubleshooting.
% Printed in purple
% -- INFOR: Notify user of normal/expected actions and events.
% Printed in green
% -- WARNG: Alert of incorrect/unexpected input; automatically recoverable.