View link-template
<blockquote> | |
<p>The is a quote from the linked page. <a href="www.example.com">§</a></p> | |
</blockquote> | |
<p>This is my comment on the link.</p> | |
View fix-epub.rb
#!/usr/bin/env ruby | |
cnt = 1 | |
cmd = ARGV[0] | |
file = ARGV[1] | |
begin | |
if cmd == "unzip" | |
system "unzip", "-q", file | |
ARGV.replace ["OPS/toc.ncx"] | |
elsif cmd == "zip" |
View wp-post.rb
#!/usr/bin/env ruby | |
require 'xmlrpc/client' | |
wordpress = XMLRPC::Client.new_from_hash( | |
{ "host" => "yourblogname", | |
"user" => "yourWPusername", | |
"password" => "yourWPpassword", | |
"use_ssl" => nil, #change to true if hosted on SSL | |
#-------------------------------------------------------# |
View wp-automator.rb
require 'xmlrpc/client' | |
wordpress = XMLRPC::Client.new_from_hash( | |
{ "host" => "yourblogurl", | |
"user" => "yourWPusername", | |
"password" => "yourWPpassword", | |
"use_ssl" => nil, #change to true if hosted on SSL | |
#-------------------------------------------------------# | |
"path" => "/xmlrpc.php" | |
}) |
View local.EDIT-FIRST.ulysses-backup.plist
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>local.ulysses-backup</string> | |
<key>ProcessType</key> | |
<string>Adaptive</string> | |
<key>ProgramArguments</key> | |
<array> |
View Minnow-KB.kbd.json
[ | |
{ | |
"name": "Minnow-KB", | |
"author": "Jennifer Mack", | |
"background": { | |
"name": "Bamboo", | |
"style": "background-image: url('/bg/wood/bamboo.jpg');" | |
}, | |
"radii": "5px", | |
"switchMount": "cherry", |
View md-tables.rb
#! /usr/bin/env ruby | |
table = "~~\n~~ <table>\n" | |
ARGF.each_line do |line| | |
table << "~~ <tr>\n" | |
row = table =~ /th/ ? "td" : "th" | |
line.chomp.split('|').each {|cell| table << "~~ <#{row}>#{cell}</#{row}>\n" } | |
table << "~~ </tr>\n" | |
end |
View md-toc.rb
#!/usr/bin/env ruby | |
toc = "# Table of Contents\n" | |
newmd = "" | |
ARGF.each_line do |line| | |
newmd << line | |
next if !line.start_with?("#") | |
heading = line.gsub("#", "").strip |
View https.go
// Redirecting (http => https) server, will finish request before shutting down. | |
// All-in-one file for example purposes | |
// Everything below main would normally go into a `server.go` file to reduce clutter. | |
// Redirection is normally on, and can be disabled with `-redir=false` on the command line. | |
// Use with dummy certs for testing. | |
package main | |
import ( | |
"context" |
View tz-diff.go
package main | |
import ( | |
"bytes" | |
"flag" | |
"fmt" | |
"text/tabwriter" | |
"time" | |
) |