Skip to content

Instantly share code, notes, and snippets.

View 5minpause's full-sized avatar

Holger Frohloff 5minpause

View GitHub Profile
@5minpause
5minpause / rss.xml
Created June 8, 2012 15:42
RSS.xml definition for octopress feed
---
layout: nil
---
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" xmlns:atom="http://www.w3.org/2005/Atom"/>
<title>{{ site.title | xml_escape }}</title>
<generator>Octopress</generator>
<link>{{ site.url }}</link>
@5minpause
5minpause / jekyllrfc822
Created July 3, 2012 16:06
Extension for jekyll to format date as rfc822
# Format a date in rfc822 format e.g. "Wed, 02 Oct 2002 15:00:00 +0200"
#
# date - The Time to format.
#
# Returns the formatted String.
def date_to_rfc822(date)
date.strftime("%a, %d %b %Y %H:%M:%S %z")
end
@5minpause
5minpause / custom rss generator
Created July 3, 2012 16:09
rss xml generator for jekyll
---
layout: nil
---
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" xmlns:atom="http://www.w3.org/2005/Atom"/>
<title>{{ site.title | xml_escape }}</title>
<generator>Octopress</generator>
<link>{{ site.url }}</link>
@5minpause
5minpause / gist:3040777
Created July 3, 2012 16:16
call rf822 date
<pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
@5minpause
5minpause / shell history
Created August 19, 2012 10:19 — forked from steveklabnik/log.txt
A fun shell script from #euruku
$ history | awk {'print $2, $3, $4'} | sort | uniq -c | sort -k1 -rn | head -n 30
577 gcoma
551 g st
533 g push
439 g add .
282 rails s
249 cap deploy
228 mvim .
167 g aa
143 g pull
@5minpause
5minpause / gemfile
Created August 20, 2012 14:09 — forked from janlelis/gemfile
Displays gem urls and summaries found in a Gemfile
#!/usr/bin/env ruby
# USAGE
# gemfile [--bundle] [--details] [--fetch] [--sorted] [--commentate]
# DESCRIPTION
# Displays gem urls and summaries found in a Gemfile.
# cd into a directory with a Gemfile and run `gemfile`
# PREREQUISITES
# gem install bundler paint
# FLAGS
@5minpause
5minpause / Settings - Default
Created August 22, 2012 08:37
Sublime Text2 preferences
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"font_face": "Menlo",
"font_size": 10,
"font_options": [],
"word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?",
"line_numbers": true,
"gutter": true,
"margin": 1,
"fold_buttons": true,
@5minpause
5minpause / publisher.rb
Created July 5, 2013 15:12
small sinatra app to listen for a post-receive hook and deploy my blog 5minutenpause.com
require 'sinatra'
require 'json'
post '/' do
if params && params[:payload]
push = JSON.parse(params[:payload])
commits = push['commits']
num_of_commits = push['commits'].length
last_commit_message = commits[num_of_commits-1]['message']
if last_commit_message =~ /publish/
@5minpause
5minpause / deploy_staging.rb
Created June 17, 2014 09:11
Script for deploying to stage
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# require 'mina/rvm' # for rvm support. (http://rvm.io)
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)
@5minpause
5minpause / deploy_production.rb
Created June 17, 2014 12:26
Script for deploying to production
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# require 'mina/rvm' # for rvm support. (http://rvm.io)
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)