This file contains 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
#!/bin/zsh - | |
############################################################################ | |
# Miller - Extract information and attributes from an Akeneo PIM log file # | |
# Pontus Sundén 2024 # | |
############################################################################ | |
if [[ $# == 0 || $1 == "--help" || $1 == "-h" ]]; then | |
echo | |
echo ' Miller - Extract information and attributes from an Akeneo PIM log file' |
This file contains 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
#! /bin/zsh - | |
######################################################################## | |
# Miller - Translate values in CSV file with mapping ("old" to "new") # | |
# Pontus Sundén 2024 # | |
######################################################################## | |
# get input from fancy command line flags | |
zmodload zsh/zutil | |
zparseopts -A ARGUMENTS -input: -map: -column: |
This file contains 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 & Qlerify commands -- Pontus Sundén 2024 # | |
############################################### | |
### BASICS | |
# List event descriptions | |
jq '.eventsJson[].description' | |
# List events with type appended (if other than "Task) |
This file contains 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
######################################### | |
# MILLER commands -- Pontus Sundén 2024 # | |
######################################### | |
# Transpose two CSV rows to a tab-separated list | |
mlr --c2d --ops tab --ofs newline cat | |
# Change each occurrence of value X | |
mlr --csv put '$* = apply(func(k,v){if(v=="X"){v="Y"};return {k:v}})' |
This file contains 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
# Convert .mkv to .mp4 | |
ffmpeg -i "${input_file}" -vcodec copy -acodec copy "${output_file_name}".mp4 |
This file contains 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
# Change encoding for text file | |
iconv -f "ISO-8859-1" -t "UTF-8" "${input_file}" -s > "${output_file}" | |
# Remove tags and move to Archive folder | |
for file in {query} | |
do | |
# remove tag information in extended attributes, FinderInfo contains color info | |
xattr -d com.apple.metadata:_kMDItemUserTags "$file" |
This file contains 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 & Jira commands -- Pontus Sundén 2024 # | |
############################################ | |
# Search Jira with jira-cmd (palashkulsh/jira-cmd) and | |
# re-structure the result into Alfred app Script Filter JSON | |
jira jql --json true "(summary ~ '$1' OR description ~ '$1') AND project IN (${projects})" | \ | |
jq '.[] | { | |
uid: .key, |
This file contains 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
;; Logseq Default Query 6-pack | |
;; --------------------------- | |
;; | |
;; Pontus Sundén (@psu) | |
;; October 28, 2022 | |
;; | |
;; Attribution | |
;; - https://gist.github.com/sawhney17/3a1b04936f35df80253431a61cb74737 | |
;; | |
;; --------------------------- |