Skip to content

Instantly share code, notes, and snippets.

@eteubert
eteubert / podlove-podcast-total-duration.twig
Last active December 7, 2016 20:15
Template für Podlove Podcast Publisher. Gesamtdauer aller Episoden.
{% set total = 0 %}
{% for episode in podcast.episodes %}
{% set total = total + episode.duration.totalMilliseconds %}
{% endfor %}
{# // is division and then rounding down (floor) #}
{% set hours = total // (1000 * 3600) %}
{% set minutes = (total // (1000 * 60)) % 60 %}
{% set seconds = (total // 1000) % 60 %}
@sebslomski
sebslomski / zalando.tamper.js
Last active December 31, 2023 15:34
Zalando Ärmelänge - in chrome, add Tampermonkey plugin. add new script. copy paste to new script
// ==UserScript==
// @name Zalando Ärmelänge
// @namespace http://sebslomski.com
// @version 0.1
// @match http://www.zalando.de/*
// @copyright 2014+, Seb
// ==/UserScript==
var $productList = $('.productsGridList.catalog');
@kmile
kmile / xml_parser.rb
Created February 15, 2011 12:53
A small nokogiri xml reader DSL.
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The
# XML Reader is a good way to move a cursor through a (large) XML document fast,
# but is not as cumbersome as writing a full SAX document handler. Read about
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html
#
# Just pass the reader in this parser and specificy the nodes that you are interested
# in in a block. You can just parse every node or only look inside certain nodes.
#
# A small example:
#