Skip to content

Instantly share code, notes, and snippets.

@orjan
orjan / subgrid.html
Created March 20, 2024 21:20
Subgrid for subtasks
<html lang="sv">
<style>
.wrapper {
display: grid;
border: solid 1px #0e2a45;
grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
}
.header {
background-color: #76baff;
}
@orjan
orjan / requeue.sh
Created June 9, 2023 07:17
Dead letter requeue
#!/bin/sh
i=0
while [ $i -ne 5 ]
do
i=$(($i+1))
az-ops-sb deadletter requeue --namespace my-namespace --topic hubb --subscription hubb | tee -a log.txt
done
@orjan
orjan / gist:957d85432f06d70b25f7d68090df1a66
Created May 10, 2023 13:06
Getting cross module references
import file from "./result.json" assert { type: "json" };
const entries = file.entries.map(entry => {
//const children = Array.from(extractChildren(entry.children));
const children = entry.children.map(child => child.name);
return {
name: entry.name,
children: children,
errors: evaluateErrors(entry.name, children)
};
@orjan
orjan / clippy.html
Created November 27, 2021 16:16
Read and parse the clipboard
<html>
<head></head>
<body>
<h1>Clippy</h1>
<p class="editor"></p>
<fieldset>
<legend>Work order form</legend>
<label for="address">Address</label><br/>
<input type="text" id="address" /><br/>
<label for="city">City</label><br/>
@orjan
orjan / vue-webpack-extend.js
Created August 30, 2021 07:45
vue-webpack-extend.js
module.exports = {
chainWebpack: config => {
config
.plugin('html')
.tap(args => {
console.log(args)
// args[0].template = '/Users/username/proj/app/templates/index.html'
return args
})
},
@orjan
orjan / filebeat.yml
Created December 2, 2020 07:38
Filebeat processor
filebeat.inputs:
- type: log
paths:
- /Users/orjan/Code/sandbox/filebeat/*.log
processors:
- if:
contains:
message: "customer"
then:
- add_fields:
@orjan
orjan / defined.j2
Created November 16, 2020 06:15
Jenkins jinja
Hello
{% if discard.builds is defined %}
discard: "{{ discard.builds }}"
artifacts: "{{ discard.artifacts | default(discard.builds) }}"
{% endif %}
By
@orjan
orjan / scratch-pad.md
Created September 10, 2020 18:29
scratch-pad.md
param_hash { "key1": "value1", "a_variable": "#{ENV['A_VARIABLE']}" }
@orjan
orjan / create-role.yml
Last active September 4, 2020 20:26
Manage Nexus Roles with Ansible
---
- name: "Get role by id: {{ role.id }}"
uri:
url: "{{ nexus_base_url }}/beta/security/roles/{{ role.id }}"
force_basic_auth: yes
user: "{{ nexus_user }}"
password: "{{ nexus_password }}"
body_format: json
status_code: [ 200, 404 ]
@orjan
orjan / filebeat.yml
Created August 13, 2020 10:19
Filebeat v7 default
###################### Filebeat Configuration Example #########################
# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html
# For more available modules and options, please see the filebeat.reference.yml sample