Skip to content

Instantly share code, notes, and snippets.

View keith's full-sized avatar

Keith Smiley keith

View GitHub Profile
@keith
keith / googleReaderOPML.rb
Created February 1, 2013 17:29
Export your google reader subscriptions to an OPML file
#!/usr/bin/env ruby
#
# => This script will authorize your Google credentials and download your Google Reader subscriptions
# => Usage: ./googleReaderOPML.rb GOOGLEUSERNAME PASSWORD
#
# The required networking shenanigans
require 'uri'
require 'net/http'
@keith
keith / compressjs.sh
Created July 2, 2013 19:14
Compresses Javascript using YUI Compressor. Expects the compiled YUI Compressor jar file to be in the same directory as the executed script
#!/usr/bin/env bash
die() {
echo "Usage $(basename $0) [infile] [outfile]"
exit
}
if [[ $# -lt 1 ]];then
die
fi
@keith
keith / atom.xml
Last active December 19, 2015 11:59
Jekyll Atom Feed
---
layout: nil
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text"><![CDATA[{{ site.name }}]]></title>
{% if site.description %}
<subtitle type="text"><![CDATA[{{ site.description }}]]></subtitle>
{% endif %}
<updated>{{ site.time | date_to_xmlschema }}</updated>
@keith
keith / excludes
Last active December 31, 2015 15:58
Backup with rsync (untested)
*/.Trash
/.bzvol
/.com.apple.NetBootX
/.fseventsd
/.hotfiles.btree
/.journal
/.journal_info_block
/.MobileBackups
/.vol/*
/afs/*
@keith
keith / fish_prompt.fish
Created February 17, 2014 02:37
Mimicking %2c from zsh
set __pwd (pwd)
set __parent (basename (dirname $__pwd))
set __current (basename $__pwd)
set __full (printf "%s/%s" $__parent $__current)
set __home (echo $HOME | awk '{ print substr($1, 2, length($1) - 1); }')
set __prompt (echo "$__full" | sed -e "s|$__home|~|" -e "s|$USER|~|" -e "s|^///|/|" -e "s|^//|/|")
@keith
keith / sudoers
Last active January 8, 2024 18:37
The default macOS 14.2.1 sudoers file
#
# Sample /etc/sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
##
# Override built-in defaults
##
@keith
keith / objcvim.md
Last active August 29, 2015 13:57
Some thoughts about a Vim plugin for Objective-C developement
  • Create new classes
    • Which project when multiple projects?
      • Not running from folder that actually has the project
        • Look in current dir
        • Look at top of git/hg/svn repo (code from investigate)?
        • Ask for path?
      • Set default project in cache?
        • Cache location local directory
      • When asking projects complete file path
  • Ask if it should default
@keith
keith / links.txt
Last active August 29, 2015 14:06
emacs for vim users
@keith
keith / search_buffers.vim
Last active August 29, 2015 14:09
Filter buffers through selecta
function! Buffers()
let ids = filter(range(1, bufnr('$')),
\ 'empty(getbufvar(v:val, "&bt"))'
\ . ' && getbufvar(v:val, "&bl")')
let names = []
for id in ids
call add(names, bufname(id))
endfor
return join(names, "\n")
@keith
keith / links.txt
Created November 14, 2014 22:58
Links about iOS and Vim