- 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").
<?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> |
// 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); |
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}}
# 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" |
#!/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 |
% 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. |