- Checkbox
![]()
| var express = require('express'); | |
| var moment = require('moment'); | |
| var ical = require('ical-generator'); | |
| var app = express(); | |
| moment.lang('de'); // make monday start of week | |
| app.get('/', function(req, res){ | |
| res.send('Subscribe to /:modulo/:residual?topic=topic i.e. <a href="http://modulocal.herokuapp.com/5/4?topic=Küchendienst">http://modulocal.herokuapp.com/5/4?topic=Küchendienst</a>.'); | |
| }); |
| module AngularCsrf | |
| def self.included(klass) | |
| klass.after_filter :set_csrf_cookie_for_ng | |
| end | |
| protected | |
| def set_csrf_cookie_for_ng | |
| cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery? | |
| end |
| # STI subclass building backported from Rails 4 to use in Rails 3.2 - see | |
| # https://github.com/rails/rails/commit/89b5b31cc4f8407f648a2447665ef23f9024e8a5 | |
| # Usage: | |
| # include BuildStiSubclass # in your model and be done | |
| module BuildStiSubclass | |
| extend ActiveSupport::Concern | |
| included do | |
| attr_accessible inheritance_column | |
| end | |
| module ClassMethods |
| # Copy and paste this to the rails console to test your email settings | |
| class MyMailer < ActionMailer::Base | |
| def test_email | |
| @recipients = "daniel.kirsch@zweitag.de" | |
| @from = "no-reply@monitor.booxoffice.de" | |
| @subject = "test from the Rails Console" | |
| @body = "This is a test email" | |
| end | |
| end |
| module AngularHelper | |
| # Usage: | |
| # In your server side rendered template | |
| # = ng_template 'path/to/partial', 'path/to/other/partial' | |
| # and then in i.e. angular directives | |
| # template: 'path/to/partial' | |
| def ng_template *partial_paths | |
| safe_join( | |
| partial_paths.map do |partial_path| | |
| content_tag 'script', render(partial_path), id: partial_path, type: "text/ng-template" |
| require 'bundler/setup' | |
| require 'rmagick' | |
| require 'awesome_print' | |
| require 'benchmark' | |
| require 'httparty' | |
| require 'json' | |
| IP = '192.168.1.144' |
| class CombinedFilter | |
| def initialize *klasses, params = {} # nicht sicher ob das funktioniert. | |
| @klasses = klasses | |
| @filters = @klasses.map do |klass| | |
| klass.new(params.slice(klass.class.attributes)) | |
| end | |
| end | |
| def to_api_hash |
![]()