Skip to content

Instantly share code, notes, and snippets.

@orjan
orjan / Dockerfile
Created March 30, 2020 14:33
sonar and ansible
FROM python:3
RUN pip install ansible-lint
RUN curl https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-linux.zip \
-o /opt/sonar-scanner-cli.zip && \
unzip /opt/sonar-scanner-cli.zip -d /opt && \
rm /opt/sonar-scanner-cli.zip && \
ln /opt/sonar-scanner-4.2.0.1873-linux/bin/sonar-scanner -s /usr/local/bin/sonar-scanner
@orjan
orjan / publish-image.sh
Created March 11, 2020 20:51
Publish a docker image
#!/usr/bin/env sh
set -e
if [ -n "$BITBUCKET_COMMIT" ]
then
echo "Running script from Bitbucket pipeline"
BUILD_SHA="$BITBUCKET_COMMIT"
BUILD_TAG="$BITBUCKET_TAG"
fi
@orjan
orjan / wip-limit.md
Created January 23, 2020 21:15
Limit the WIP

Work-In-Process (WIP)

Why I think it's important to have some kind in WIP limit, independent on Scrum vs Kanban.

Knowledge sharing

Having a limit makes sure more than one in the team knows what we're doing.

Flow and decreased lead time, small batches

The most important thing can be shipped asap and start generate value. Instead of batching up the work and shipping everything in the end. Compare this when ecom was doing 1 release every 7:th week and released

@orjan
orjan / index.md
Created January 22, 2020 21:07
logstash

input { file { path => "/opt/logs/*.log" start_position => "beginning" } beats { port => 5044 } }

@orjan
orjan / resolve-handlers.cs
Created November 22, 2019 12:41
Resolve handlers without guice
using System;
using Autofac;
using com.labs2.brikks;
using com.labs2.brikks.bbs.action.handlers;
using com.labs2.brikks.handler;
using com.labs2.brikks.server.engines.gaps;
using com.labs2.brikks.server.engines.report;
using com.labs2.brikks.server.engines.report.datasources;
using java.lang;
using Labs2.Brikks.Tasks.Process.Handlers;
@orjan
orjan / build.cake
Last active November 7, 2019 13:34
Finding new msbuild
#tool nuget:?package=vswhere&version=2.8.4
#tool nuget:?package=GitVersion.CommandLine&version=3.6.5
#addin "nuget:?package=Cake.Incubator&version=5.1.0"
/*
https://stackoverflow.com/questions/46232442/whats-the-difference-between-bin-msbuild-exe-and-bin-amd64-msbuild-exe
*/
var target = Argument("target", "Default");
// -find MSBuild\**\Bin\MSBuild.exe
@orjan
orjan / guicekiller.cs
Created November 1, 2019 09:35
A possible way to remove the guice dependency
using Autofac;
using com.labs2.brikks.handler;
using com.labs2.brikks.util;
using Xunit;
namespace Labs2.Brikks.Tasks.Process.Handlers
{
public class AutoFacResolver : IHandlerResolver
{
private readonly ILifetimeScope lifetimeScope;
/*
This idea was spawned when trying to upgrade react router to v4 where `getComponent` is removed.
*/
const asyncModuleLoader = () => {
const modules = []
const createAsyncComponent = (resolveModule, fetchWhenIdle = false) => {
if (fetchWhenIdle) {
modules.push(resolveModule)
}
@orjan
orjan / readme.md
Last active March 22, 2018 05:41
JS build stuff
@orjan
orjan / suspend.kt
Created December 8, 2017 11:46
Suspend client calls
suspend fun BoundRequestBuilder.suspendExecute(): Response {
return suspendCancellableCoroutine { cont: CancellableContinuation<Response> ->
this.execute(object : AsyncCompletionHandler<Response>() {
override fun onCompleted(response: Response?): Response {
cont.resume(response!!)
return response
}
})
}
}