Skip to content

Instantly share code, notes, and snippets.

namespace :doc do
namespace :diagram do
task :models do
sh "railroad -i -l -a -m -M | dot -Tpng | sed 's/font-size:14.00/font-size:12.00/g' > doc/models.png"
end
task :controllers do
sh "railroad -i -l -C | dot -Tpng | sed 's/font-size:14.00/font-size:12.00/g' > doc/controllers.png"
sh "gwenview ./doc/models.png"
end
#!/bin/bash
# write an English text string as an audio file using Google Translate
# usage: en2audio.sh <text>
wget -q -U Mozilla -O "german-$*.mp3" "http://translate.google.com/translate_tts?ie=UTF-8&tl=de&q=$*"
@forkrul
forkrul / Unix tips
Last active December 14, 2015 16:28
Unix tricks
# http://mmb.pcb.ub.es/~carlesfe/unix/tricks.txt
I have marked with a * those which I think are absolutely essential
Items for each section are sorted by oldest to newest. Come back soon for more!
BASH
* In bash, 'ctrl-r' searches your command history as you type
- Add "set -o vi" in your ~/.bashrc to make use the vi keybindings instead
of the Emacs ones. Takes some time to get used to, but it's fantastic!
- Input from the commandline as if it were a file by replacing
'command < file.in' with 'command <<< "some input text"'
#! /usr/bin/env ruby
# encoding: UTF-8
require 'date'
since = ARGV.shift || Date.today
logs = `git log --since="#{since}" --pretty=format:"%H,%ae,%ai"`
all_commits = logs.split("\n").map{|i| i.split(",") }
ffmpeg -i hlah_3.flac -strict experimental -acodec vorbis -aq 100 hlah.ogg
@forkrul
forkrul / gist:9942575
Created April 2, 2014 20:34
rename recursively with testing
# requires bash > 4
shopt -s globstar
rename -n 's/special/regular/' ** #remove n when testing is done
#!/bin/bash
set -e
# Usage:
# rsync_parallel.sh [--parallel=N] [rsync args...]
#
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
#
# Notes:
#!/bin/sh
# https://rawsontetley.org/ref_steamlinkwine.html
env
cd ~
PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
unset LD_PRELOAD
unset LD_LIBRARY_PATH
unset SYSTEM_PATH
/usr/bin/playonlinux --run "Steam"
@forkrul
forkrul / todo.el
Last active June 3, 2018 12:15 — forked from prathik/todo.el
Manage daily todo files on Emacs
(defun todo-create-directory (directory)
"Creates the todo directory."
(if (file-exists-p directory) (message "Directory exists")
(make-directory directory)
(message "Directory created")
))
(defun create-todo-file (directory filename)
"Checks if the todo file exists if not creates it."
(create-directory directory)