Skip to content

Instantly share code, notes, and snippets.

Avatar

Dominik Weiss dasgib

View GitHub Profile
View mdb2sql.sh
#!/bin/bash
# Convert a MDB file (Access) to SQL
# Needs mdbtools[http://mdbtools.sourceforge.net/]
# run 'aptitude install mdbtools' on Debian/Ubuntu
# Created by Álvaro Justen <https://github.com/turicas>
# License: GPLv2
mdb=$1
sql=$2
@dasgib
dasgib / gist:3782943
Created Sep 25, 2012
Copy all songs in a .m3u file exported via iTunes to a new directory
View gist:3782943
IFS=$'\n'; mkdir playlist; for FILE in `tr "\r" "\n" < playlist.m3u | grep -v "^#"`
do
SONG=`basename $FILE`
ALBUM=`basename ${FILE/$SONG//}`
ARTIST=`basename ${FILE/$ALBUM\/$SONG//}`
cp $FILE "./playlist/$ARTIST - $ALBUM - $SONG"
done
@dasgib
dasgib / compass-retina-sprites.scss
Created Jun 23, 2012 — forked from thulstrup/compass-retina-sprites.scss
Using Compass to generate normal and retina sprite maps
View compass-retina-sprites.scss
$sprites: sprite-map("sprites/*.png");
$sprites-retina: sprite-map("sprites-retina/*.png");
@mixin sprite-background($name) {
background-image: sprite-url($sprites);
background-position: sprite-position($sprites, $name);
background-repeat: no-repeat;
display: block;
height: image-height(sprite-file($sprites, $name));
width: image-width(sprite-file($sprites, $name));
@dasgib
dasgib / svg2png
Created Jun 23, 2012
Use Imagemagick to convert .SVG to .PNG
View svg2png
#!/bin/bash
if [ -z "$1" ] || [ -z "$3" ] || [ -z "$3" ]
then
echo "Syntax: svg2png <source.svg> <dest.png> <16x16> [<negate>]"
else
if [ -z "$4" ]
then
convert -background none -resize $3 -gravity center -extent $3 $1 $2
else
@dasgib
dasgib / .zshrc
Created Dec 20, 2011
pathed_cd for zsh - start new shell in last used directory
View .zshrc
pathed_cd () {
if [ x"$1" = x ]; then
cd
else
cd "$1"
fi
pwd > ~/.cdpath
}
View dasgib.zsh-theme
PROMPT='%{$fg[white]%} %{$fg[green]%}%2~ %{$fg[grey]%}$(git_prompt_info)%{$fg[yellow]%}→ %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_CLEAN=" "
@dasgib
dasgib / userChrome.css
Created Mar 23, 2011
Hides the star-icon from Firefox 3/4 addressbar
View userChrome.css
/* hide star icon in address bar */
#star-button { display: none !important }
@dasgib
dasgib / userChrome.css for FF4 OSX
Created Mar 23, 2011
~/Library/Application Support/Firefox/Profiles/xxxxxxx.default/chrome/userChrome.css
View userChrome.css for FF4 OSX
/* Tab Arrangement */
.tab-close-button { -moz-box-ordinal-group: 1 !important;}
.tab-text { -moz-box-ordinal-group: 2 !important;}
.tab-throbber { -moz-box-ordinal-group: 3 !important;}
.tab-icon-image { -moz-box-ordinal-group: 4;}
.tabbrowser-tab[pinned] .tab-icon-image {
visibility: visible !important;
}
View images_helper.rb
module ImagesHelper
# Acts as a thin wrapper for image_tag and generates an srcset attribute for regular image tags
# for usage with responsive images polyfills like picturefill.js, supports asset pipeline path helpers.
#
# image_set_tag 'pic_1980.jpg', { 'pic_640.jpg' => '640w', 'pic_1024.jpg' => '1024w', 'pic_1980.jpg' => '1980w' }, sizes: '100vw', class: 'my-image'
#
# => <img src="/assets/ants_1980.jpg" srcset="/assets/pic_640.jpg 640w, /assets/pic_1024.jpg 1024w, /assets/pic_1980.jpg 1980w" sizes="100vw" class="my-image">
#
def image_set_tag(source, srcset = {}, options = {})
srcset = srcset.map { |src, size| "#{asset_path(src)} #{size}" }.join(', ')
@dasgib
dasgib / todoist.userstyle.css
Last active Aug 29, 2015
Userstyle for todoist.com (Non-Premium)
View todoist.userstyle.css
/* hide useless stuff */
#td_logo,
#notifications_counter,
#completed_items {
display: none !important;
}
#top_filters {
padding-top: 0 !important;