Skip to content

Instantly share code, notes, and snippets.

@kepano
kepano / obsidian-web-clipper.js
Last active May 3, 2024 07:21
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@andy-thomason
andy-thomason / Genomics_A_Programmers_Guide.md
Created May 14, 2019 13:32
Genomics a programmers introduction

Genomics - A programmer's guide.

Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.

https://www.genomicsplc.com

import re
import json
# save the positive words into a list called p_list
with open('positive.txt') as f:
p_txt = f.read()
p_txt = re.sub('[,\.()":;!@#$%^&*\d]|\'s|\'', '', p_txt)
p_list = p_txt.replace('\n',' ').replace(' ',' ').lower().split(' ')
# test if cool is in the list
print 'cool is in the postive list: ', 'cool' in p_list
@tilofrei
tilofrei / ajt-ama-style.tex
Last active May 13, 2019 02:39
Biblatex style for the American Journal of Transplantation (similar to AMA style)
% Biblatex style for the American Journal of Transplantation (similar to AMA style)
% I used remus' suggestions as a template: https://tex.stackexchange.com/a/233423/115062
% To use this just include in your tex-file
% configuring package options
\usepackage[backend=bibtex, bibencoding=utf8, citestyle=numeric-comp, bibstyle=numeric, sorting=none, maxbibnames=6, minbibnames=3, doi=false, isbn=false, url=false, uniquename=false, uniquelist=false, firstinits=true, terseinits=true]{biblatex}
% BEGIN DEFINE CITATION STYLE
% first after last name
\DeclareNameAlias{default}{last-first}
@ijstokes
ijstokes / anaconda_latest_pkgs_no_versions.txt
Last active April 11, 2023 16:32
Anaconda Latest: packages in the latest release of Anaconda (currently 4.4), without versions. This can be used to update all (and only) the packages that are found in Anaconda to the latest available version, since (you may be surprised to learn) the command `conda update anaconda` will not do this for you (see explanation below).
alabaster
anaconda-client
anaconda-navigator
anaconda-project
appnope
appscript
asn1crypto
astroid
astropy
babel
@ygit
ygit / SkipVerification.txt
Last active March 29, 2024 08:27
Skip Verification of Mac Apps
xattr -d com.apple.quarantine /path/to/app/myMacApp.app
@asmaloney
asmaloney / Packaging_Example.sh
Last active September 14, 2023 14:45
This is an example of script to package up and create a DMG for a Mac OS X app. Details may be found here: http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/
#!/bin/bash
# by Andy Maloney
# http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/
# make sure we are in the correct dir when we double-click a .command file
dir=${0%/*}
if [ -d "$dir" ]; then
cd "$dir"
fi
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active January 4, 2024 10:20
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@stefanschmidt
stefanschmidt / remove-annotations.sh
Last active February 1, 2024 17:01
Remove all annotations from a PDF document
pdftk original.pdf output uncompressed.pdf uncompress
LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf
pdftk stripped.pdf output final.pdf compress