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
| javascript:(function(){ | |
| var url = window.location.href; | |
| var strippedUrl = url.split('?')[0]; | |
| if (navigator.clipboard) { | |
| navigator.clipboard.writeText(strippedUrl).then(function() { | |
| console.log('URL copied to clipboard successfully!'); | |
| }).catch(function(err) { | |
| console.error('Could not copy URL: ', err); | |
| }); | |
| } else { |
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
| import json | |
| from datetime import datetime | |
| from os import path | |
| DATA_DIR = 'data' | |
| VAULT_DIR = 'vault' | |
| JOURNAL = 'World' | |
| def parse_date(s: str): | |
| datestr = s[0:10] |
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
| (* | |
| Contacts-Obsidian Sync | |
| May 24, 2023 | |
| This script syncs Contacts to Obsidian files. It is lightweight and not | |
| intended to be a robust solution covering edge cases. This script assumes: | |
| - There is a 1:1 correlation between a Person and an Obsidian file. | |
| - The Obsidian file is in a certain format. |
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
| <%* | |
| /** | |
| To use this script: | |
| 1) Create an empty page in your Templater folder and copy this script into it | |
| 2) Go to page where you'd like to insert the list of Pages and their Tags | |
| 3) Use the Command Palette to "Open Insert Template Modal" | |
| 4) Select the page with this script | |
| **/ | |
| tR += "# Page Tags (Auto Generated)\n\n" |
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
| tell application "Contacts" | |
| -- set allContacts to every person | |
| set allContacts to selection | |
| repeat with aContact in allContacts | |
| set allPhones to phones of aContact | |
| repeat with aPhone in allPhones | |
| if label of aPhone is "WORK" then | |
| set label of aPhone to "work" |
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
| for i in *.txt | |
| do | |
| # ${i%%.*} uses Bash expansion to strip off the file extension | |
| echo mv $i ${i%%.*}-suffix.txt | |
| done |
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
| function guid() { | |
| function s4() { | |
| return Math.floor((1 + Math.random()) * 0x10000) | |
| .toString(16) | |
| .substring(1); | |
| } | |
| return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | |
| s4() + '-' + s4() + s4() + s4(); | |
| } |
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
| import nltk | |
| from nltk.book import * | |
| from nltk.probability import FreqDist |
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
| console.log('NODE_PATH=' + process.env.NODE_PATH); |
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
| /* On the first time this file is loaded, check the database for proper | |
| structure and version. If it doesn't exist, create it or update it. | |
| */ | |
| var connectionString = "pg://schou@localhost/heroku_db"; | |
| pg.connect(connectionString, function(err, client, done) { | |
| console.log("simple query started"); | |
| client.query('SELECT * FROM test_table', function(err, result) { | |
| console.log(result.rows[0].sender); | |
| }); | |
| // client.on('error', function(err) { |