Skip to content

Instantly share code, notes, and snippets.

@fengtan
fengtan / gist:b2d11946e74e414d0051eb4c29bb5ca1
Created August 17, 2023 13:45
Turn Mattermost archive into readable format
jq -r '.posts[] | ("\u001b[34m" + (.created | fromdate | strftime("%c")) + "\u001b[32m " + .username + "\u001b[0m: " + .message)' < ./mattermost-channels.json
@fengtan
fengtan / hyperlinks-html-markdown-jira.js
Last active August 22, 2023 18:35
Generate hyperlinks for Jira, Gitlab, ServiceNow or drupal.org and copy to clipboard
#!/usr/bin/env Rscript
# Given:
#
# V | X1 | X2 | X3 | Y1 | Y2 | Y3
# -------------------------------
# A | A | B | C | 2 | 3 | 5 <-- A matches X1, return 2
# B | A | B | B | 6 | 4 | 5 <-- B matches X2,X3, return 4,5
#
# We want:
#!/usr/bin/env Rscript
df <- data.frame(
"V" = c("A", "B"),
"X" = c("A", "A"),
"Y" = c("B","B"),
"Z" = c("B", "C"),
"X1" = c(2, 4),
"Y2" = c(3,4),
"Z3" = c(5, 5)