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
import os # Import the os module for working with environment variables | |
import openai # Import the OpenAI module for working with the OpenAI API | |
import json # Import the json module for working with JSON data | |
import sys # Import the sys module for working with command-line arguments | |
openai.api_key = os.getenv("OPENAI_API_KEY") # Set the OpenAI API key from an environment variable | |
filename = sys.argv[1] # Get the filename from the command-line arguments | |
with open(filename, "r") as file: # Open the file in read-only mode |
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
#!/usr/bin/env bash | |
# Convert markdown to pdf with same filename and open the pdf | |
for file in "$@"; do | |
filename="${file%.*}" | |
extension="${file##*.}" | |
echo "$file" "->" "$filename".pdf | |
pandoc -f markdown -t pdf -o "$filename".pdf "$file" | |
open "$filename".pdf | |
done |
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
function rc(){ | |
# TODO XDG Path | |
EDITORRC="$EDITOR" | |
FILE="" | |
case "$1" in | |
help) | |
printf "aliasesicalbuddy\n" | |
printf "aliasestask\n" | |
printf "aliases\n" |
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
CODE | EFFECT | NOTE | |
---|---|---|---|
0 | Reset / Normal | all attributes off | |
1 | Bold or increased intensity | ||
2 | Faint (decreased intensity) | Not widely supported. | |
3 | Italic | Not widely supported. Sometimes treated as inverse. | |
4 | Underline | ||
5 | Slow Blink | less than 150 per minute | |
6 | Rapid Blink | MS-DOS ANSI.SYS; 150+ per minute; not widely supported | |
7 | [[reverse video]] | swap foreground and background colors | |
8 | Conceal | Not widely supported. |
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
COMMAND | DEFINITION | |
---|---|---|
a2x | A toolchain manager for AsciiDoc (converts Asciidoc text files to other file formats) | |
abduco | terminal session manager | |
abook | text-based address book program | |
abs | integer absolute value function | |
ack | grep-like text finder | |
aclocal | manual page for aclocal 1.16.3 | |
acountry | print the country where an IPv4 address or host is located | |
acyclic | make directed graph acyclic | |
addftinfo | add information to troff font files for use with groff |
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
#!/usr/bin/env bash | |
# Print definition of COMMAND, i.e. the line following NAME in its manpage | |
# https://gist.github.com/marekkowalczyk/5dcae326d2148c2757c386776ae455d7 | |
man $1 | col -b | grep -A 3 ^NAME | sed -n 2,3p | sed -E 's/^ +//' | tr '\n' ' ' | |
printf "\n" |
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
-- Import a man page into DEVONthink as PDF | |
-- Created by Christian Grunenberg on Sat Apr 16 2005. Copyright (c) 2005-2019. All rights reserved. | |
-- Edited by Houthakker 2011 Feb 12 to import PDF (rather than text) version of man page (to preserve highlighting of keywords and headers) | |
-- Modified on 2021-01-25 by https://discourse.devontechnologies.com/u/pete31/ and https://discourse.devontechnologies.com/u/marekkowalczyk/ to add auto tagging of imported PDFs | |
tell application id "DNtp" | |
try | |
repeat | |
set page to display name editor "Man page" info "Enter the man page to import:" | |
if page is not "" then exit repeat |
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
#! /usr/bin/awk -f | |
# Basic interactive CLI RPN (Reverse Polish Notation) calculator | |
# v1.1 | |
# input: arithmetic expressions in RPN | |
# output: values of expressions | |
# Adapted by [email protected] from Aho, Kernighan, and Weinberger, The AWK Programming Language, 143. | |
# 2021-01-26 CC0 1.0 Universal (CC0 1.0) | |
# https://gist.github.com/marekkowalczyk/06eb0d7d850fd50497b0f65d350d0003 |
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
--- | |
header-includes: \usepackage{noto}\urlstyle{tt}\usepackage{titlesec}\titlelabel{\thetitle.\quad} | |
numbersections: true | |
papersize: a4 | |
lang: en | |
documentclass: article | |
title: DevonThink Search Operators | |
--- | |
In the toolbar search field, as well as in both the interactive and the simple |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"log" | |
"os" | |
"strings" | |
"time" | |
) |
NewerOlder