This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Generate hyperlinks for Jira, Gitlab, ServiceNow or drupal.org and copy to clipboard | |
// @namespace https://gist.github.com/fengtan/4493530e0989b896692d3804937e17a9 | |
// @version 1.1 | |
// @description View a page in Jira, Gitlab, ServiceNow or drupal.org, and then hit Alt+H, Alt+M or Alt+J: this will copy an HTML, markdown or jira-formatted hyperlink of this page to the system clipboard | |
// @author fengtan | |
// @include *gitlab* | |
// @include *jira*/browse/* | |
// @include *jira*/issues/* | |
// @include *.service-now.com/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq -r '.posts[] | ("\u001b[34m" + (.created | fromdate | strftime("%c")) + "\u001b[32m " + .username + "\u001b[0m: " + .message)' < ./mattermost-channels.json |