Skip to content

Instantly share code, notes, and snippets.

View bcdavasconcelos's full-sized avatar

Bernardo C.D.A. Vasconcelos bcdavasconcelos

View GitHub Profile
@bcdavasconcelos
bcdavasconcelos / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Created March 25, 2022 14:41 — forked from ccstone/BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@bcdavasconcelos
bcdavasconcelos / Tinderbox-Ruby.rb
Created January 20, 2022 21:24
This ruby class is aimed at the XML files of the macOS app Tinderbox with methods to parse attributes, links and notes.
#!/Users/bcdav/.rbenv/shims/ruby
# frozen_string_literal: false
Encoding.default_external = Encoding::UTF_8
# Bernardo C. D. A. Vasconcelos #
# 2022-01-06-10-02 #
# A Ruby class for Tinderbox Documents with methods to parse attributes, links and notes.
# It deals directly with the XML file and does not rely on the application's OAS interface.
@bcdavasconcelos
bcdavasconcelos / find_missing_references.rb
Last active May 4, 2022 14:35
I use this script to find bibliographical @references cited in my markdown files (using the Pandoc syntax) that happen to be absent from the bibliography file.
#!/usr/bin/env ruby
# frozen_string_literal: false
# I use this script to find bibliographical @references (using the Pandoc syntax) cited in my markdown files
# that happen to be absent in the bibliography file.
# Pandoc syntax: [@Ref] → (Author + Year) / [-@Ref] → (Year)
Encoding.default_external = Encoding::UTF_8
#!/usr/bin/env ruby
# frozen_string_literal: false
# bcdav 2021
# inspired by https://github.com/ltrgoddard/inliner
Encoding.default_external = Encoding::UTF_8
class String
def inline_mmd
@bcdavasconcelos
bcdavasconcelos / Pisium Night.css
Last active December 12, 2023 17:12
Pisium CSS for Obsidian with several modifications
/* global */
:root
{
--font-size-normal: 26px;
--font-size-code: 22px;
--font-size-side-dock: 13.5px;
--font-size-side-dock-title: 15px;
--font-size-blockquote: 20px;
--font-size-status-bar: 12px;
--line-height-preview: 1.7em;
@bcdavasconcelos
bcdavasconcelos / San Ho Dark.css
Last active October 15, 2021 13:38
CSS style sheet for rendering Markdown in different apps (such as DEVONthink 3, nvUltra, MMD Composer) #CSS #Markdown
/* San Ho Dark - https://www.dropbox.com/s/pbd8ka36rflz71c/Captura%20de%20tela%202020-01-06%2020.59.31.png?dl=0 */
body {
font-family: "EB Garamond";
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100% margin: 0;
padding: 50px 2rem 2rem;
max-width: 800px;
}
@bcdavasconcelos
bcdavasconcelos / San Ho Light.css
Last active June 24, 2020 00:07
CSS style sheet for rendering Markdown in different apps (such as DEVONthink 3, nvUltra, MMD Composer) #CSS #Markdown
/* "Cormorant Garamond SemiBold" */
body {
font-family: "Alegreya";
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100% margin: 0;
padding: 50px 2rem 2rem;
width: auto;
/* max-width: 800px; */
}
@bcdavasconcelos
bcdavasconcelos / styles.css
Last active January 6, 2020 23:42
Dark mode theme for Learning with Texts (http://lwt.sourceforge.net) #CSS #LWT
/**************************************************************
"Learning with Texts" (LWT) is free and unencumbered software
released into the PUBLIC DOMAIN.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a
compiled binary, for any purpose, commercial or non-commercial,
and by any means.
@bcdavasconcelos
bcdavasconcelos / diogenes.css
Last active May 4, 2022 14:53
Dark mode theme for Diogenes #CSS #Diogenes
html {
height: 100%;
margin: 0;
}
body {
background-color: #434140;
color: #ffffff;
font-family: 'Gentium Plus';
font-synthesis: weight;
height: 100%;
@bcdavasconcelos
bcdavasconcelos / DT3 and Zotero.scpt
Last active January 6, 2020 23:40
Still on test phase, so to speak. #Archive
tell application id "DNtp"
set theRecords to the selection
if theRecords is {} then error "Please select some contents."
repeat with theRecord in theRecords
set customMD to custom meta data of theRecord
try
set theBibkey to mdbibkey of customMD