Skip to content

Instantly share code, notes, and snippets.

View adamesque's full-sized avatar

Adam Luikart adamesque

View GitHub Profile
@adamesque
adamesque / adamluikart.zsh-theme
Created March 12, 2012 19:04
My totally awesome oh-my-zsh theme.
local user_host='%{$fg[green]%}%n@%m%{$reset_color%}'
local current_dir='%{$fg[yellow]%} %~%{$reset_color%}'
local git_branch='$(git_prompt_info)%{$reset_color%}'
PROMPT="
${user_host}${current_dir} ${git_branch}
⑆ "
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
@adamesque
adamesque / 2012.txjs.sh
Created March 9, 2012 19:13
Notify folks as soon as the 2012 txjs site is updated.
#!/bin/bash
CHECK=`/usr/bin/curl --write-out %{size_download} --silent --output /dev/null 2012.texasjavascript.com`
cd ~
if [ $CHECK != 123 ] && [ ! -e '.2012.txjs.sent' ]
then
/usr/bin/curl -s -k --user api:key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
https://api.mailgun.net/v2/xxxxxxxxxxx.mailgun.org/messages \
-F from=' <txjsbot@xxxxxxxxxxx.mailgun.org>' \
-F to=xx@xxxxxxxxxxx.com\
@adamesque
adamesque / sha1_cache_buster.rb
Created February 10, 2012 01:58
SHA1 cache buster extension for Middleman 2.x
module Middleman::Features
# modeled after built-in CacheBuster extension
# appends truncated SHA1 hashes to the querystring of asset_url'd files.
module Sha1CacheBuster
require 'digest/sha1'
class << self
def registered(app)
app.set :sha1_asset_paths, []
app.send :include, InstanceMethods
@adamesque
adamesque / front-end-dev.md
Created January 12, 2012 23:55
Front-End Web Developer

Front-End Web Developer

A little about us

thirteen23 is looking for a front-end web developer to join our boutique software design and development agency. We're a small, tight-knit team of designers and developers who collaborate on each project from start to finish.

Because we're so small, you'll have the freedom to be creative and solve problems your own way. With freedom comes responsibility, though, so it'll be up to you to nail the execution, all the way down to the fit & finish.

A little about you

@adamesque
adamesque / lastmod.bash
Created October 17, 2011 02:01
Bash alias to get the last modified file in a directory
# Naive NOT-FOR-PRODUCTION method. Fails for filenames that contain newlines.
alias lastmod="ls -t | head -n 1"
@adamesque
adamesque / hyphenated-completion.vim
Created August 8, 2011 16:00
Tell vim to treat '-' as a keyword char for tab completion in HTML & CSS files.
if has("autocmd")
" Treat '-' as a keyword char in HTML & CSS
autocmd InsertEnter *.{html,haml,css,scss,sass,slim} setlocal iskeyword+=-
autocmd InsertLeave *.{html,haml,css,scss,sass,slim} setlocal iskeyword-=-
endif
@adamesque
adamesque / .bash_profile
Created July 19, 2011 19:25
My .bash_profile
if [ -f /usr/local/etc/bash_completion.d/git-completion.bash ]; then
source /usr/local/etc/bash_completion.d/git-completion.bash
fi
alias ls="ls -F"
alias l="ls -G"
alias la="ls -a"
alias ll="ls -al"
alias ps="ps -ajx"
alias cdd="cd"
@adamesque
adamesque / config.ru
Created June 2, 2011 21:05
Feature-incomplete Middleman/Rack::Rewrite demo
require 'rubygems'
require 'rack-rewrite'
require 'middleman'
use Rack::Rewrite do
rewrite %r{^/([^\./]+)/?$}, '/$1.html'
end
run Middleman::Server
@adamesque
adamesque / config.ru
Created June 1, 2011 19:09
Password-protected Middleman via Rack/Heroku
require 'rubygems'
require 'middleman'
middleman_app = Middleman::Server.new
protected_middleman = Rack::Auth::Basic.new(middleman_app) do |username, password|
[username, password] == ['theuser', 'thepassword']
end
run protected_middleman
@adamesque
adamesque / gist:940823
Created April 25, 2011 17:00
Calculate elapsed time (to be added to a "When did you mean to turn this off" Harvest overnight timer UI)
(new Date("Apr 22 2011 17:00") - new Date("Apr 22 2011 16:01")) / (1000 * 60 * 60)