Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Peters ChristianPeters

View GitHub Profile
@ChristianPeters
ChristianPeters / zweitag.tpondemand.com.js
Created Nov 24, 2016
TargetProcess buttons to convert Iteration print view to documentation for contracts
View zweitag.tpondemand.com.js
$(function() {
addPerformModificationsButton = function(mode, showComplexity) {
var button;
button = $('<a class="button-box x-button user-action button small ui-print__controls__print" role="button"></a>');
var withComplexity;
withComplexity = showComplexity ? '(mit Komplexität) ' : '';
if (mode == 'planning') {
button.append('<span class="">Zu Planungsdokumentation ' + withComplexity + 'konvertieren</span>');
} else if (mode == 'review')
button.append('<span class="">Zu Abnahmedokumentation ' + withComplexity + 'konvertieren</span>');
@ChristianPeters
ChristianPeters / zweitag.tpondemand.com.js
Last active Dec 10, 2015
Export eines Sprints aus Targetprocess zur Dokumentation von Sprintplanung und Sprintreview/Abnahme
View zweitag.tpondemand.com.js
$(function() {
addPerformModificationsButton = function(mode) {
var button;
button = $('<a class="button-box x-button user-action button small ui-print__controls__print" role="button"></a>');
if (mode == 'planning')
button.append('<span class="">Zu Planungsdokumentation konvertieren</span>');
else if (mode == 'review')
button.append('<span class="">Zu Abnahmedokumentation konvertieren</span>');
$('body').prepend(button);
button.click(function() {
View example_feature_spec.rb
around { |example| with_wait_time(6) { example.run } }
@ChristianPeters
ChristianPeters / config-application.rb
Created Apr 16, 2012
Adapted for Rails Asset Pipeline: Split CSS files so that there are no more than a given number of selectors in one style sheet. This is a tool to cope with Internet Explorer's limitation of max. 4095 selectors per stylesheet.
View config-application.rb
#...
module MyProject
class Application < Rails::Application
config.assets.precompile += %w( ie6.css ie6_portion2.css ie7.css ie7_portion2.css ie8.css ie8_portion2.css ie9.css ie9_portion2.css)
#...
@ChristianPeters
ChristianPeters / selectivizr-ajax-hover-fix.js.coffee
Last active Oct 1, 2015
selectivizr does not support ajax. These listeners add live support for the CSS :hover pseudo selector for links and buttons, so that they are styled in IE < 9 even if they are dynamically injected.
View selectivizr-ajax-hover-fix.js.coffee
$ ->
$('body')
.on 'mouseenter', 'a, button, input[type=submit]', ->
$(this).addClass('slvzr-hover')
.on 'mouseleave', 'a, button, input[type=submit]', ->
$(this).removeClass('slvzr-hover')
View jquery.radiofy.js
/* jQuery Radiofy
* ==============
* Turns a select into a hidden text input and
* a set of radio buttons that resemble the options.
* This is used to enable client_side_validations for radio buttons.
* ---
* Daniel Kirsch
* (c) 2012 Zweitag GmbH
*/
(function($){
View Zuordnung von fashmob Kategorien zu Google Kategorien.yml
# men (men)
men: "Bekleidung & Accessoires > Bekleidung"
# Accessoires (men > Accessoires)
men_accessoires: "Bekleidung & Accessoires > Bekleidungsaccessoires > Gürtel"
# Gürtel (men > Accessoires > Gürtel)
men_accessoires_guertel: "Bekleidung & Accessoires > Bekleidungsaccessoires"
# Hüte & Mützen (men > Accessoires > Hüte & Mützen)
men_accessoires_huete_muetzen: "Bekleidung & Accessoires > Bekleidungsaccessoires"
# Schals & Tücher (men > Accessoires > Schals & Tücher)
men_accessoires_schals_tuecher: "Bekleidung & Accessoires > Bekleidungsaccessoires"
@ChristianPeters
ChristianPeters / css_splitter.rake
Created Aug 8, 2011
Split CSS files so that there are no more than a given number of selectors in one style sheet. This is a tool to cope with Internet Explorer's limitation of max. 4095 selectors per stylesheet.
View css_splitter.rake
require 'rake'
require 'css_splitter'
desc 'split css files'
namespace :css do
task :split do
infile = ENV['infile'] || raise("missing infile")
outdir = ENV['outdir'] || File.dirname(infile)
max_selectors = ENV['max_selectors'] || 4095
View gist:748382
def javascript(print_tag = false, &block)
content_for(:javascript) do
if print_tag
js = Proc.new { block.call }
javascript_tag(&js)
else
capture(&block)
end
end
end
@ChristianPeters
ChristianPeters / gist:703357
Created Nov 17, 2010
This script implements a register of calls in order to have guarded access on a (shared) single dom element. In particular, the flash message div (user notification banner) should only fade out if the last user notification has been displayed for 5-6 secs
View gist:703357
// Module that encapsulates access to numberOfCalls and numberOfCompletedCalls.
// Facilitates the ensurance that every flash message is displayed for 5-6 sec.
// Use registerOne() to register a flash message (before calling fade!).
// Use completeOne() once to indicate that a flash message has passed its display time.
// Use allowFade() in order to ask whether the flash div can be faded out now.
Register = function () {
var numberOfCalls = 0;
var numberOfCompletedCalls = 0;
return {