Skip to content

Instantly share code, notes, and snippets.

@somerandomnerd
somerandomnerd / EnableNaturalScrolling.scpt
Last active October 13, 2022 15:37
Quickly Enable/Disable natural scrolling on OSX
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.trackpad"
end tell
tell application "System Events"
tell process "System Preferences"
click radio button "Scroll & Zoom" of tab group 1 of window "Trackpad"
set theCheckbox to checkbox 1 of tab group 1 of window "Trackpad"
@somerandomnerd
somerandomnerd / Automator - turn URL into MarkDown link with page title
Created October 30, 2014 01:17
A simple shell script to stick into Automator, to take a plain text URL, get the title from the web page, and turn it into a Markdown link. Requires the Nokogiri gem to be installed.
@somerandomnerd
somerandomnerd / 0_Proper_Nouns_regex.md
Last active December 28, 2015 16:29
Regular expression for identifying proper nouns
(([A-Z]([a-z]+|\.+))+(\s[A-Z][a-z]+)+)|([A-Z]{2,})|([a-z][A-Z])[a-z]*[A-Z][a-z]*
@somerandomnerd
somerandomnerd / 0_sentence_splitting_regex.txt
Last active December 28, 2015 02:39
Regular expression for splitting sentences
(?<=[a-z])[\.?!]\s(?=([A-Z][a-z]|A |I |[A-Z]\.))|…|\.\.\.
@somerandomnerd
somerandomnerd / natural_language_chunk.txt
Last active December 28, 2015 02:39
Short chunk of text for testing NLP parsing
This first bit is my own punctuation-filled rambling. Way back, I learned my ABCs – what some might write as A.B.C.s, but they would be wrong, because it isn't an acronym. Good writers don't need to know them. I mean, I'm pretty sure that P.G. Wodehouse knew his alphabet, but that isn't what made him great. Likewise, GCSEs and A levels probably don't matter all that much. Why? Because its all about passion! Isn't it?! Writing something that conveys emotion is something that people can do; computers can't. One thing I know Mr. Wodehouse could do well is put humanity into his text.
This next bit is ripped off from a website. Link below...
Another ex-Golden Stater, Paul Stankowski from Oxnard, is contending for a berth on the U.S. Ryder Cup team after winning his first PGA Tour event last year and staying within three strokes of the lead through three rounds of last month's U.S. Open. H.J. Heinz Company said it completed the sale of its Ore-Ida frozen-food business catering to the service industry to McCain Fo
@somerandomnerd
somerandomnerd / 0_reuse_code.js
Created November 12, 2013 10:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console