Skip to content

Instantly share code, notes, and snippets.

View schoren's full-sized avatar

Sebastian Choren schoren

View GitHub Profile
@schoren
schoren / calculate_max_time.sh
Last active October 30, 2023 13:51
Script to calculate max attempts for an exponential backoff retry strategy
#!/bin/bash
# Usage: ./calculate_max_time.sh <initial_backoff> <backoff_multiplier> <max_backoff> <max_total_time>
# Command line arguments
initial_backoff=$1
backoff_multiplier=$2
max_backoff=$3
max_total_time=$4
<VAST version="3.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<Ad id="20001">
<InLine>
<AdSystem version="4.0">iabtechlab</AdSystem>
<AdTitle>iabtechlab video ad</AdTitle>
<Pricing model="cpm" currency="USD">
<![CDATA[ 25.00 ]]>
</Pricing>
@schoren
schoren / FeatureContext.php
Created November 15, 2011 19:55
email bug configuration
<?php
namespace BigContacts\UserBundle\Features\Context;
use Behat\BehatBundle\Context\BehatContext,
Behat\BehatBundle\Context\MinkContext;
use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
@schoren
schoren / _custom_multiselect.html.haml
Created July 19, 2011 19:30
Custom view for rails_admin to create related HABTM records
:ruby
config = field.associated_model_config
selected = field.bindings[:object].send(field.association[:name])
selected_ids = selected.map(&:id)
xhr = field.associated_collection_count > 100
if xhr
collection = selected.map do |o|
[o.send(config.object_label_method), o.id]
end
else