This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| counter=0; | |
| for i in $(./kafka-consumer-groups.sh --list --bootstrap-server localhost:9092); do | |
| printf '\r%3d'$counter; | |
| if [[ $(./kafka-consumer-groups.sh --describe --group $i --bootstrap-server localhost:9092 2>/dev/null | grep $TOPIC) ]]; then | |
| echo " " + $i | |
| fi; | |
| ((counter++)) | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " be iMproved | |
| set nocompatible | |
| " Vundle setup | |
| " Plugin manager | |
| " | |
| " Brief help: | |
| " :PluginList - list configured bundles | |
| " :PluginInstall(!) - install(update) bundles | |
| " :PluginSearch(!) foo - search(or refresh cache first) for foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| begin | |
| require 'bundler/inline' | |
| rescue LoadError => e | |
| $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
| raise e | |
| end | |
| gemfile(true) do | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def require_persistently(gem_name) | |
| begin | |
| require gem_name | |
| rescue LoadError | |
| puts "Installing #{gem_name}..." | |
| `gem install #{gem_name}` | |
| Gem.clear_paths | |
| retry | |
| ensure | |
| require gem_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://github.com/ianwhite/pickle | |
| # https://github.com/goncalossilva/acts_as_paranoid | |
| # | |
| # Given you created a 'deleted' factory | |
| # And then you want to match it in steps with #{capture_model} like followiwng: | |
| # | |
| # Given a deleted user "Turanga Leela" exists | |
| # Then /^(?:|I )select #{capture_model} from the table$/ do |user| | |
| # model!(user) | |
| # end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // add some spice | |
| console.log = function() { | |
| window.alert(Array.prototype.slice.call(arguments, 0).join(' ')); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # First, there is another (simple) way to accomplish the task and I would suggest to never use approach shown below. I mean stub page#source. | |
| # | |
| # Given there are several steps which rely on `page#source`, for instance checking contents of downloaded CSV file. | |
| # And we decided to store several CSV files in the cloud | |
| # And we still want to test their contents | |
| # Then we test output of file generators | |
| # But we want to reuse and DO NOT TOUCH existing steps checking CSV files contents | |
| # Then we decide to stub page#source | |
| # Simple solution, nothing interesting here, you can skip it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Ptchk; def prns?; Date.today.friday? end; end; Ptchk.new.prns? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {* @param Array $items collection of items to list *} | |
| {* @param int $columnsCount quantity of colums in list representation *} | |
| <ul style="white-space: nowrap;"> | |
| {assign var=itemsCount value=$items|@count} | |
| {assign var=inColumn value=$itemsCount/$columnsCount|@ceil} | |
| {foreach from=$items item=item key=key} | |
| {if $key%$inColumn==0} | |
| <ul style="width:250px;display:inline-block;vertical-align:top;"> |