Skip to content

Instantly share code, notes, and snippets.

View amaierhofer's full-sized avatar

Andreas Maierhofer amaierhofer

View GitHub Profile
@amaierhofer
amaierhofer / clear_emails
Last active August 29, 2015 14:24
Lists emails and prompts for deletion
def clear_emails
Mail.find_and_delete(count: MailRelay::Base.retrieve_count) do |message|
print "#{message.subject} - delete(y/n): "
if gets == 'y'
message.mark_for_delete = true
puts "deleted."
else
puts ""
end
end

Caching

Problemstellung

  • Peaks (von 50 auf 5000 Clients)
  • Multiprozess Architektur (Versandmodul, cron jobs, shared db)
  • Langsame Antwortzeiten aufgrund von DB Queries

Demo v5 API

Title

Towards understandable, maintainable code.

Explain how OO and ruby work together in producing readable, flexible, fun to work with code.

Why is this important

  • Code as conversation

Methods at the core

  • good method goals
@amaierhofer
amaierhofer / redmine.js
Created March 20, 2013 15:17
redmine user script
// ==UserScript==
// @name Redmine customizations
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match https://redmine.puzzle.ch/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @require file:///home/ama/.dotfiles/tampermonkey/redmine.js
// @copyright 2012+, You
// ==/UserScript==
module Game exposing (..)
import Matrix exposing (..)
import Array exposing (..)
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Debug exposing (..)
#!/bin/sh
ROOT=~/dev/pzl/hitobito
RUBY_VERSION=2.1.5
link() {
echo "linking $1 -> $2"
ln -s "$1" "$2"
}
target=$1
group :development do
ENV.fetch('WAGONS').split.each do |wagon|
gem "hitobito_#{wagon}", :path => "../hitobito_#{wagon}"
end
end
group :production do
ENV.fetch('WAGONS').split.each do |wagon|
gem "hitobito_#{wagon}", :path => "../hitobito_#{wagon}"