Skip to content

Instantly share code, notes, and snippets.

View tgray's full-sized avatar
😬
.

Tim Gray tgray

😬
.
View GitHub Profile
module Jekyll
# The purpose of this plugin is to allow non-post pages show up the category
# index pages. Creates a new site attribute, articles. It's a hash of all
# of the pages (not posts) that contain the category 'articles'. This hash
# uses the pages categories as the keys, and all of the pages with that
# category are the values.
#
# Extensions to the Jekyll Site class. For use with Octopress.
#
@tgray
tgray / create_article.rb
Created January 8, 2012 02:50 — forked from bobthecow/create_article.rb
nanoc create_article command
# encoding: utf-8
# got this and modified it from: https://gist.github.com/1103291
usage 'create_article [options] identifier'
summary 'create an article'
aliases :ca
description <<-EOS
Create a new article in the current site. The first data source in the site
configuration will be used.
EOS
#!/bin/sh -
# Adds the first argument (a URL) to yojimbo as a bookmark. Using the -a
# switch, one can add it as a web archive instead. Optional arguments 2 and 3
# can be used to set the title and the comment of the bookmark. These have no
# effect if making a web archive.
#
# Originally designed to import newsbeuter bookmarked items into yojimbo
print_help()
{
# ledger v3.0 fish completions
# Tim Gray - 2013-05-22
# vim: set ft=fish norl ts=2 sw=2 sts=2 :
# check to see if we have an empty 'ledger' command.
function __fish_ledger_bare
set cmd (commandline -opc)
if [ (count $cmd) -eq 1 -a $cmd[1] = 'ledger' ]
return 0
end
# tab completions for the Fish shell <http://fishshell.org>
#
# taskwarrior - a command line task list manager.
#
# Copy this script to ~/.config/fish/completions/task.fish, open a new shell,
# and enjoy.
#
# Objects completed:
# * Commands
# * Projects
@tgray
tgray / feed.xml
Last active August 29, 2015 14:12
feedbin debugging gist
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
<title>The Online Photographer</title>
<link rel="alternate" type="text/html" href="http://theonlinephotographer.typepad.com/the_online_photographer/" />
<id>tag:typepad.com,2003:weblog-1321040</id>
<updated>2014-12-23T10:06:44-06:00</updated>
<generator uri="http://www.typepad.com/">TypePad</generator>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/typepad/ZSjz" /><feedburner:info uri="typepad/zsjz" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href=

Updating my brew formulas

Note - This just a note for myself on how I should update my brew formulas for new versions.

I typically open up the formula and change the URL and the SHA1. Get the SHA1 by downloading the tarball (or archive) and running the following command on the command line:

openssl dgst -sha1 <FILE>
@tgray
tgray / README.md
Last active August 12, 2017 20:41
A set of scripts to manage version numbers with Xcode and git. Primarily aimed at command line tools.

Updating program version numbers

Note - The following could hold true for any Xcode project, but I only really have one, [contacts][], so it is pretty specific to that project.

Instructions

  1. Change the number in the file VERSION.
  2. Tag the final commit with the version number:
    git tag -am '0.1' 0.1
  3. Push the tag to github:
@tgray
tgray / pinimport.py
Created January 2, 2015 16:43
Python script for bulk import of links into inboard. Input is two files, one with urls and one with titles.
#!/usr/bin/env python
# https://github.com/tgray
import urllib, sys, os
import argparse
def importFile(filename):
filename = os.path.expanduser(filename)
try:
f = open(filename)

wpblog

wpblog is a python script that works with a [Wordpress][] installation via XML-RPC.

Text file format

Files have the following simple format:

Title: your title here

Date: 2015-01-02 23:16:12