Skip to content

Instantly share code, notes, and snippets.

View dentarg's full-sized avatar
🌦️
=:D><!

Patrik Ragnarsson dentarg

🌦️
=:D><!
View GitHub Profile
#!/usr/bin/ruby
require 'rubygems'
require 'icalendar'
require 'date'
include Icalendar
icsfile = "tentor.ics"
@dentarg
dentarg / last.fm-loved-tracks.rb
Created July 19, 2009 15:23
last.fm loved tracks
#!/usr/bin/env ruby
require 'rubygems'
require 'net/http'
require 'rexml/document'
require 'rss/maker'
# data source
# http://www.lastfm.se/api/show?service=329
user = ""
@dentarg
dentarg / merge_pdfs.sh
Created October 2, 2009 15:29
Mergs PDF files using GhostScript
#!/bin/sh
if [ $# -eq 0 ]; then
echo 1>&2 Usage: $0 output.pdf source.pdf [source2.pdf ...]
exit 127
fi
for arg in $*
do
let "i += 1"
@dentarg
dentarg / hd2dvd.sh
Created March 23, 2010 22:36
Convert HD video to DVD format (and burn it)
#!/bin/sh
# TODO: Check binaries
# unrar, mencoder, dvdauthor, mkisofs
# Only one argument
if [ $# -ne 1 ]; then
echo 1>&2 Usage: $0 /path/to/dir/with/rars
exit 127
fi
@dentarg
dentarg / .zshrc
Created April 19, 2010 17:45
My .zshrc file
#!/usr/local/bin/zsh
#
# jage <johan@imum.net> http://jage.se
# dentarg <patrik@starkast.net> http://dentarg.net
#
# Settings
#OPENBSD_CVS='anoncvs@anoncvs.se.openbsd.org:/cvs'
OPENBSD_CVS='anoncvs@anoncvs.de.openbsd.org:/cvs'
NETBSD_CVS='anoncvs@anoncvs.se.netbsd.org:/cvsroot'
@dentarg
dentarg / gist:371355
Created April 19, 2010 17:52
ls -al home.git
total 128
drwxr-xr-x 22 dentarg staff 748 Apr 15 10:20 ./
drwxr-xr-x+ 99 dentarg staff 3366 Apr 19 19:52 ../
-rw-r--r-- 1 dentarg staff 1377 Feb 13 21:48 .Xdefaults
-rw-r--r-- 1 dentarg staff 223 Mar 14 2009 .gemrc
drwxr-xr-x 16 dentarg staff 544 Apr 15 10:20 .git/
-rw-r--r-- 1 dentarg staff 779 Mar 23 23:36 .gitconfig
-rw-r--r-- 1 dentarg staff 100 Aug 25 2009 .gitmodules
-rw-r--r-- 1 dentarg staff 235 Nov 29 2008 .hgrc
drwxr-xr-x 3 dentarg staff 102 May 2 2009 .lftp/
# From http://www.reddit.com/r/linux/comments/akt3j/a_functional_programming_style_map_function_for/
# Modified to work in zsh.
function map() {
local command i rep
if [ $# -lt 2 ] || [[ ! "$@" =~ :[[:space:]] ]];then
echo "Invalid syntax." >&2; return 1
fi
until [[ $1 =~ : ]]; do
command="$command $1"; shift
done
@dentarg
dentarg / arvika.rb
Created July 15, 2010 02:05
Spelschema för Arvikafestivalen
#!/usr/bin/env ruby
require 'rubygems'
require 'icalendar'
require 'date'
include Icalendar
# raw data looks like this
#
# \n
# location\n
@dentarg
dentarg / emmaboda.rb
Created July 27, 2010 00:04
Spelschema för Emmabodafestivalen
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"
require 'tzinfo'
require 'ri_cal'
DEBUG = false
YEAR = 2011
@dentarg
dentarg / emmaboda.ics
Created July 27, 2010 00:18
Spelschema för Emmabodafestivalen
BEGIN:VCALENDAR
X-WR-CALDESC;VALUE=TEXT:Spelschema
X-WR-CALNAME;VALUE=TEXT:Emmabodafestivalen
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:iCalendar-Ruby
BEGIN:VEVENT
LOCATION:Tr�dg�rden
SEQUENCE:0
DTEND:20100728T210000