Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
""" | |
Whois client for python | |
https://gist.github.com/n8henrie/dc55b8fb366710003b5d3c557dfc4469 | |
transliteration of: | |
http://www.opensource.apple.com/source/adv_cmds/adv_cmds-138.1/whois/whois.c | |
The MIT License (MIT) |
This file contains 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
"""dateformat.py :: Format free text date in yyyymmdd format.""" |
This file contains 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
"""newpost.py :: Create a new draft for n8henrie.com | |
Args: | |
--drafts-dir: Path to drafts directory | |
""" | |
import datetime | |
import argparse | |
This file contains 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
# Script for irssi to trigger macOs Notification Center | |
# Nathan Henrie (modifications, ©2016) | |
# Inspired by https://github.com/paddykontschak/irssi-notifier/blob/master/notifier.pl | |
# | |
# Currently notifies if mentioned by nickname or if PMed | |
# Only sends a static message to avoid arbitrary command execution by `system` | |
# | |
## Installation: | |
# Copy to `~/.irssi/scripts/` (and symlink to `~/.irssi/scripts/autorun` if desired) |
This file contains 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
"""time_stuff.py :: A bunch of `timeit` comparisons for different snippets. | |
The module just loads the tests, so you can run specific examples interactively | |
if desired: | |
$ python3 -i <(curl -s https://gist.githubusercontent.com/n8henrie/db6880e2c84df153c5ae19d5dba16757/raw) | |
>>> find_vs_split_vs_re() | |
Best of 10000 runs over 5 repeats | |
test_find: 0.0087874069577083 | |
test_split: 0.013382209988776594 |
This file contains 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
property test_str : "This is a test note." | |
on process_text(str) | |
set time_str to current date | |
try | |
tell application "Notes" | |
-- log (get properties of first note) | |
set scratchpad to first note whose name is "#scratchpad #scratchpad" | |
set notebody to body of scratchpad |
This file contains 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
// Downloads all Project Euler problems into directory `outdir` | |
// With queue of 10 runs in about 43 seconds for 582 problems | |
// Python asyncio solution was about 42 secs | |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"log" |
This file contains 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
go*.linux-armv6l.tar.gz |
This file contains 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
property test_block_text : " | |
this and | |
that and | |
asdf | |
" | |
on process_text(block_text) | |
-- AppleScript and Quicksilver are using code "e2 80 a8" as linebreak for some reason | |
-- inspect by piping to `hexdump -C` and viewing with `echo -e` | |
set perl to "/usr/bin/perl -0777 -pe 's#(^[[:space:]\\xe2\\x80\\xa8]*)|([[:space:]\\xe2\\x80\\xa8])*$##g' <<<" |