my_key_link: 'World'
my_key: 'Hello %{link}!' link: link_to(t('my_key_link'), 'xy')
'Hello <a href="xy">World</a>!'
- Need to check if
raw
is required everytime - Translators can loose the context
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_USER_AGENT} Darwin/9 | |
RewriteRule ^/index\.sucatalog$ http://%{HTTP_HOST}/cgi-bin/SoftwareUpdateServerGetCatalog?/index-leopard.merged-1.sucatalog | |
RewriteCond %{HTTP_USER_AGENT} Darwin/10 | |
RewriteRule ^/index\.sucatalog$ http://%{HTTP_HOST}/cgi-bin/SoftwareUpdateServerGetCatalog?/index-leopard-snowleopard.merged-1.sucatalog | |
RewriteCond %{HTTP_USER_AGENT} Darwin/11 | |
RewriteRule ^/index\.sucatalog$ http://%{HTTP_HOST}/cgi-bin/SoftwareUpdateServerGetCatalog?/index-lion-snowleopard-leopard.merged-1.sucatalog | |
RewriteCond %{HTTP_USER_AGENT} Darwin/12 | |
RewriteRule ^/index\.sucatalog$ http://%{HTTP_HOST}/cgi-bin/SoftwareUpdateServerGetCatalog?/index-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog |
-- The MIT License (MIT) | |
-- | |
-- Copyright (c) 2014 Boris Penck | |
-- | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy | |
-- of this software and associated documentation files (the "Software"), to deal | |
-- in the Software without restriction, including without limitation the rights | |
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
-- copies of the Software, and to permit persons to whom the Software is | |
-- furnished to do so, subject to the following conditions: |
#!/usr/bin/env ruby | |
require 'koala' # gem install koala --no-ri --no-rdoc | |
# create a facebook app and get access token from here | |
# https://developers.facebook.com/tools/explorer | |
# select "groups", "photos" when authenticating | |
oauth_access_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |
group_filtering_words = ['ruby'] | |
image_path = 'image.png' #change to your image path | |
message = 'My Cool image.' # your message |
# disable layout | |
page ".htaccess.apache", :layout => false | |
# rename file after build | |
after_build do | |
File.rename 'build/.htaccess.apache', 'build/.htaccess' | |
end |
#!/usr/bin/env ruby | |
ENV['RAILS_ENV'] = 'test' | |
require 'benchmark' | |
rails_loading_time = Benchmark.measure { require './config/environment' } | |
puts "Rails env loaded in #{rails_loading_time}" | |
NUM_FORKS = 2 | |
test_groups = `find ./spec -type f -iname "*foobar*"`.split("\n").in_groups(NUM_FORKS).to_a |
I had a little trouble figuring this out - so making a note of it.
The VMWare Fusion default location for VMs is ~/Documents/Virtual Machines.localized
,
which doesnt work well for me as I typically have Documents symbolically linked to my Dropbox
directory and prefer to move the default VM location rather than manage exclusions on every
Dropbox install I have.
It's relatively straightforward on VMWare Workstation, and Oracle VirtualBox - but for some reason
This is just some stencils I created for myself to draw FMC (http://www.fmc-modeling.org/) diagrams with draw.io.
Here is how they look:
# Kernel sysctl configuration file for Linux | |
# | |
# Version 1.12 - 2015-09-30 | |
# Michiel Klaver - IT Professional | |
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant | |
# | |
# This file should be saved as /etc/sysctl.conf and can be activated using the command: | |
# sysctl -e -p /etc/sysctl.conf | |
# | |
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details. |
This is a RESTful Rails controller, implementing all 7 RESTful actions. In my Rails apps, 9 out of 10 controllers will end up looking like this.
class PostsController < ApplicationController
load_and_authorize_resource
def create
@post.save and redirect_to(@post) or render(:new)
end