This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Offene Fragen | |
# - In diesem Szenario, wie wird hier sichergestellt, dass es nur genau ein tile image gibt? | |
# Theoretisch müsste portfolio_item.tile_image.first_or_create funktionieren? | |
# - Weiterhin nimmt dieses Szenario an, dass nur ein "Liste" von Source Images | |
# existiert, also die Uploads im eigene Portfolio und in der Detailansicht | |
# nicht unterschieden werden. Das müsste zuvor mit den Business-Leuten noch | |
# abgestimmt werden. | |
class PortfolioItem::Image < ActiveEceord::Base | |
extend Dragonfly::Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# This python script allows you to change the unity/gnome keyboard | |
# settings for swapping the meta (windows) and alt keys. Should work with | |
# Python 2.7 and 3.2 | |
from gi.repository import Gio | |
class KeySwapper: | |
SWAP_ALT_WIN='altwin\taltwin:swap_lalt_lwin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switching projects like mad? | |
# t: start or restore a tmux session named after your current working directory | |
# | |
# e.g. calling t in /home/project/awesome_project will reattach the tmux session named | |
# awesome_project or create a new one | |
t() { tmux attach-session -t $(pwd | awk -F/ '{print $NF}') || tmux new-session -s $(pwd | awk -F/ '{print $NF}') ; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'text/hyphen' | |
describe Text::Hyphen do | |
let(:described_class) do | |
Text::Hyphen | |
end | |
it "should hyphenate vierschanzentourne correctly" do | |
hh = described_class.new(:language => 'de', :left => 2, :right => 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails edge includes pluggable sanitizers for mass assignment. Really cool is the | |
# StrictSanitizer which raises an exception instead of a log message, which makes | |
# problems easier to spot in development. | |
# For the time being, there seems to be no way to achieve this in Rails 3.1 via | |
# configuration. Monkey patching to the rescue! | |
# Copy the gist into config/initializers and configure the environments in which the | |
# exception gets raised. | |
if ['development', 'test'].include?(Rails.env) | |
ActiveModel::MassAssignmentSecurity::BlackList.class_eval do |