Skip to content

Instantly share code, notes, and snippets.

@jteneycke
jteneycke / gist:5323379
Created April 5, 2013 23:06
Return every file in a directory that matches the html file type, even if it's missing it's extension.
for f in `find . -type f`; do file "$f"; done | grep "HTML document" | cut -d ":" -f 1
@jteneycke
jteneycke / gist:5323384
Created April 5, 2013 23:07
Convert found recursive list of html files to haml.
for f in `cat list.txt`; do html2haml "$f" > $f.haml; echo "Converting $f"; done
;;;
;;; Blog post at http://wp.me/p12FcK-3
;;;
;;; Loom: http://github.com/jkk/loom
;;; GraphViz: http://graphviz.org
;;; Ubigraph: http://ubietylab.net/ubigraph/
;;;
(ns user
(:use [clojure.string :only [lower-case split-lines join]]
@jteneycke
jteneycke / gist:5446884
Created April 23, 2013 19:57
bash ruby git fancy prompt
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
function parse_ruby_version {
rbenv version-name
}
RED="\[\033[0;31m\]"
@jteneycke
jteneycke / ruby_hamlize.rb
Last active December 16, 2015 15:18
ruby hamlize
#!/usr/bin/env ruby
Dir.glob("*.html.erb").each do |erbname|
hamlname = erbname.gsub(".html.erb", ".html.haml")
system "/usr/bin/html2haml #{erbname} #{hamlname}"
end
@jteneycke
jteneycke / .vimrc
Last active December 16, 2015 15:59
vimrc
set nocompatible " be iMproved
set number
set mouse=a
set expandtab
syntax on
filetype off " required!
if &term =~ '256color'
#switch default editor for pry to sublime text
Pry.config.editor = "vim"
#format prompt to be <Rails version>@<ruby version>(<object>)>
Pry.config.prompt = proc do |obj, level, _|
prompt = "\e[1;30m"
prompt << "#{Rails.version} @ " if defined?(Rails)
prompt << "#{RUBY_VERSION}"
"#{prompt} (#{obj})>\e[0m"
end
@jteneycke
jteneycke / gist:5603094
Created May 18, 2013 03:10
pretty git log
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
html, body, .container, .content {
height: 100%;
}
.container, .content {
position: relative;
}
.proper-content {
padding-top: 40px; /* >= navbar height */
@jteneycke
jteneycke / meetup-no-notify.js
Created August 6, 2013 19:33
bookmarket to uncheck all of the boxes on the email page of each group. Made with http://chriszarate.github.io/bookmarkleter/
javascript:(function(){$('input[type=checkbox]').prop('checked',false);$('input[type=radio][value=1]').prop('checked',true);})();