Skip to content

Instantly share code, notes, and snippets.

View fractaledmind's full-sized avatar

Stephen Margheim fractaledmind

View GitHub Profile
@wcaleb
wcaleb / blookup.py
Last active March 20, 2020 22:10
Use OttoBib.com and ISBNdb.com to generate a formatted bibliographic citation from an author-title search string. More explanation here: <http://wcm1.web.rice.edu/get-citations-with-isbndb-and-ottobib.html>
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# blookup.py
# by Caleb McDaniel <http://wcm1.web.rice.edu>
# Uses ottobib.com and isbndb.com to turn an author-title search string
# into a formatted bibliographic citation.
# Example:
# blookup.py "blight race and reunion"
@ttscoff
ttscoff / everwatch.rb
Created April 6, 2013 18:48
New version of EverWatch for integrating Marked with Evernote
#!/usr/bin/env ruby
# everwatch.rb by Brett Terpstra, 2011
# http://brettterpstra.com/2011/11/14/marked-scripts-nvalt-evernote-marsedit-scrivener/
# http://support.markedapp.com/kb/how-to-tips-and-tricks/marked-bonus-pack-scripts-commands-and-bundles
# Updated for latest Evernote configuration (2013) and quick launch of Marked.app - spetschu
#
# Watch Evernote for updates and put the current content of the editor into a preview file for Marked.app
# <http://markedapp.com>
require 'shellwords'
@ttscoff
ttscoff / grab links.bookmarklet
Last active February 20, 2025 09:55
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.
@davemenninger
davemenninger / gist:6022994
Created July 17, 2013 18:12
Uses tesseract, hocr2pdf, and pdfconcat to build a OCR'ed ( searchable ) PDF from a dir full of tif files. Inteded use is with the output of a diybookscanner and ScanTailor.
#!/bin/bash
for img in *.tif; do tesseract $img $img hocr; done
for img in *.tif; do hocr2pdf -i $img -o $img.pdf < $img.html; done
pdfconcat -o merged.pdf ./*.pdf
@muzizongheng
muzizongheng / Main.py
Created July 18, 2013 06:57
loop to get evernote's notes
# List all of the notebooks in the user's account
notebooks = noteStore.listNotebooks(authToken)
print("Found ", len(notebooks), " notebooks:")
#calculate processed blog count currently
processedBlogCount = 0
for notebook in notebooks:
print(" * ", notebook.name)
@JosefJezek
JosefJezek / how-to-use-pelican.md
Last active March 13, 2025 08:47
How to use Pelican on GitHub Pages
@fractaledmind
fractaledmind / Export All Skim Notes with Markdown Reference Links
Created July 24, 2013 04:37
This script will (as the title suggests) export all of you Skim notes to a text editor (either TextEdit or TextMate) in Markdown format, with reference style links. It relies on the GENERATE TOP 3 NOTES WITH SYSTEM URL script that will put 3 notes at the top of the PDF with linking information.
@ttscoff
ttscoff / Bullseye.bookmarklet
Last active February 20, 2025 09:55
A bookmarklet for grabbing just a piece of a web page and converting it to Markdown using heckyesmarkdown.com.
javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://cdn.rawgit.com/ttscoff/6109434/raw/Bullseye.js?x="+(Math.random());})();
@bmschmidt
bmschmidt / TesseractPDF.sh
Last active December 24, 2015 08:09
Make Tifs from pdfs using gs and then perform OCR on them using tesseract.
#!/usr/bin/sh
#Adapted by Ben Schmidt from Barry Hubbard's code at
#http://www.barryhubbard.com/articles/37-general/74-converting-a-pdf-to-text-in-linux
#to convert into a folder of text files, each one representing a page.
#This takes pdfs from the pdfs folder, writes tif files to the images folder, and writes text to the texts folder.
#each pdf gets a _folder_ in each of the other two.
mkdir -p texts
mkdir -p images
@creationix
creationix / path.js
Created November 12, 2013 18:10
Simple path join and dirname functions for generic javascript
// Joins path segments. Preserves initial "/" and resolves ".." and "."
// Does not support using ".." to go above/outside the root.
// This means that join("foo", "../../bar") will not resolve to "../bar"
function join(/* path segments */) {
// Split the inputs into a list of path commands.
var parts = [];
for (var i = 0, l = arguments.length; i < l; i++) {
parts = parts.concat(arguments[i].split("/"));
}
// Interpret the path commands to get the new resolved path.