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
# --- | |
# Code gehört in app/helpers/application_helper.rb (oder einen anderen Helper…) | |
# --- | |
# Ausgabe: "Vor mehr als 5 Monaten"/"Vor etwa einem Jahr" — statt "Dauer: mehr als 5 Monate"/"Dauer: etwa 1 Jahr", wie es die Originalfunktion liefert | |
# Original-File: actionpack/lib/action_view/helpers/date_helper.rb, line 63 | |
# Dokumenation: http://apidock.com/rails/v2.3.8/ActionView/Helpers/DateHelper/distance_of_time_in_words | |
# Changelog: I18n.with_options-Scope geändert auf "distance_in_words_gebeugt" | |
def distance_of_time_in_words_gebeugt(from_time, to_time = 0, include_seconds = false, options = {}) | |
from_time = from_time.to_time if from_time.respond_to?(:to_time) |
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
# inspired by http://ariejan.net/2010/08/23/resque-how-to-requeue-failed-jobs | |
# retry all failed Resque jobs except the ones that have already been retried | |
# This is, for instance, useful if you have already retried some jobs via the web interface. | |
Resque::Failure.count.times do |i| | |
Resque::Failure.requeue(i) unless Resque::Failure.all(i, 1)['retried_at'].present? | |
end | |
# retry all :) | |
Resque::Failure.count.times do |i| |
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
# inspired by http://ariejan.net/2010/08/23/resque-how-to-requeue-failed-jobs | |
# retry all failed Resque jobs except the ones that have already been retried | |
# This is, for instance, useful if you have already retried some jobs via the web interface. | |
Resque::Failure.count.times do |i| | |
Resque::Failure.requeue(i) unless Resque::Failure.all(i, 1)['retried_at'].present? | |
end | |
# retry all :) | |
Resque::Failure.count.times do |i| |
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 'resque/tasks' | |
namespace :resque do | |
def del(key) | |
Resque.redis.keys(key).each { |k| Resque.redis.del(k) } | |
end | |
desc "Resque setup according to installation guide" | |
task :setup => :environment |
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
Mounting an EBS-Storage | |
Variables: | |
@device_name = /dev/sdf | |
@device_mount = xvdf | |
@mount_point = /my_space | |
Select the EBS-Storage in the AWS-Console (Web-Interface) and attach it to the desired device. | |
Here you can set the @device_name which is shown in your instance as @device_mount. |
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
// The following data should be run in the console while viewing the page https://read.amazon.com/ | |
// It will export a CSV file called "download" which can (and should) be renamed with a .csv extension | |
var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024); | |
getAmazonCsv = function() { | |
// Set header for CSV export line - change this if you change the fields used | |
var csvData = "ASIN,Title,Authors,PurchaseDate\n"; | |
db.transaction(function(tx) { |