Skip to content

Instantly share code, notes, and snippets.

import com.azure.spring.cloud.core.properties.AzureProperties;
import com.azure.spring.cloud.stream.binder.eventhubs.config.EventHubsBinderConfiguration;
import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubsBinderConfigurationProperties;
import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubsExtendedBindingProperties;
import com.azure.core.amqp.AmqpTransportType;
import com.azure.core.amqp.ProxyOptions;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
@kell05
kell05 / httpoison_err
Created December 23, 2020 17:22
Error: HTTPoison error
# Request
:hackney_trace.enable(:max, :io)
result = HTTPoison.get("https://www.mybramble.co.uk",[], [ssl: [{:versions, [:"tlsv1.2"]}]])
# Hackney trace
[hackney trace 80 <0.252.0> 2020:12:23 16:40:27 4121] request
Content: [{module,hackney},
{line,313},
{method,get},
@kell05
kell05 / WagammaCurry.txt
Created January 12, 2017 20:33
Nom Nom Curry Recipe
Wagamama Cheat Recipe
Raisukaree curry my cheat recipe
I'm extremely proud of this recipe. When Jon first tried it he classed it as a taste sensation and I'd have to agree.
I went to wagamamas about a year ago and ordered this curry. I was blown away by the flavour and new I had to try and recreate it myself. I tried to look up recipes for it, but could only find a couple, so I've adapted them and made them into this one.
#!/bin/bash
# Argument = -t test -r server -p password -v
usage()
{
cat << EOF
usage: $0 options
This script run the test1 or test2 over a machine.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
# create our directories
@kell05
kell05 / gist:3793858
Created September 27, 2012 12:59
Order files by disk usage
alias orderbysize="du --max-depth=1 -k | sort -nr | cut -f2 | xargs -d '\n' du -sh"
@kell05
kell05 / gist:3004689
Created June 27, 2012 15:09
Delimit file
File.open('data.txt','r') do |f|
data = f.read
puts data.gsub(/(.+)\n/){$1+"\t"}
end
# Example 1
def file_read(filename)
file = File.new(filename,'r')
yield file # file is the variable passed into the block (anything between do and end is a block) f is the variable used the access this in example 1 usage.
file.close
end
# Example 1 usage
file_read('temp.rb') do |f| # f is the file descriptor for accessing methods on the file
puts f.read # reads the whole file as a string puts is essentially println in java
@kell05
kell05 / gist:2881906
Created June 6, 2012 13:38
Redirecting Stdout to string
# For internal code
module Kernel
def capture_stdout &block
out = StringIO.new
$stdout = out
yield
return out
ensure
$stderr = STDOUT
end