Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# A script to delete namespace(s) stuck at "Terminating" state, that won't get deleted, within the OpenShift cluster.
# You'll see an error message like this below, when you try "oc delete project <namespace>"
#
# Error from server (Conflict): Operation cannot be fulfilled on namespaces "<namespace>": The system is ensuring all content is removed from this namespace. Upon completion, this namespace will automatically be purged by the system.
#
# Inspired by </ Jeffery Bagirimvano >
# Modified by Daniel Petisme
.Where(point => point.Y > 4);
@danielpetisme
danielpetisme / Program.cs
Created June 11, 2019 20:23
.Net Method Extensions
using System;
using System.Collections.Generic;
using System.Linq;
public static class StringExtension
{
public static string Capitalize(this string str) {
return char.ToUpper(str[0]) + str.Substring(1);
}
@danielpetisme
danielpetisme / Program.cs
Created June 11, 2019 19:53
.Net Data Objects
using System;
using System.Collections.Generic;
using System.Linq;
public class UserDTO {
public string Id { get; set; }
public string Login { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
@danielpetisme
danielpetisme / DataObject.cs
Last active June 11, 2019 19:52
dotnet demos
using System;
using System.Collections.Generic;
using System.Linq;
public class UserDTO {
public string Id { get; set; }
public string Login { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
@danielpetisme
danielpetisme / building-my-first-quarkus-extension.asciidoc
Last active January 10, 2023 10:58
Building my first Quarkus Extension

Building my first Quarkus Extension

Quarkus extensions enhance your application just as projects dependencies do. The role of the extensions is to do all the technical piping to make third-party libraries/technologies Quarkus-compatible. This is how you can use your battle-tested ecosystem and take advantage of Quarkus perfomance and native compilation

Prerequisites

To complete this guide, you need:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.myapp</groupId>
<artifactId>jhipster-sample-app-azure</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>jhipster-sample-app-azure</name>
@danielpetisme
danielpetisme / jhipster-jib.sh
Created September 24, 2018 11:32
JHipster jib Integrqtion
#-------------------------------------------------------------------------------
# Run Docker
#-------------------------------------------------------------------------------
if [ "$RUN_APP" == 1 ]; then
if [[ "$PROFILE" == "prod" ]]; then
cd "$APP_FOLDER"
if [ -f "mvnw" ]; then
./mvnw -DskipTests package jib:dockerBuild -P"$PROFILE"
elif [ -f "gradlew" ]; then
@danielpetisme
danielpetisme / script.sh.template
Last active October 7, 2017 13:45
Shell script template
#!/usr/bin/env bash
# Inspired by https://dev.to/thiht/shell-scripts-matter
set -euo pipefail
IFS=$'\n\t'
#/ Usage:
#/ Description:
#/ Examples:
@danielpetisme
danielpetisme / rancher-metricbeat.yml
Created July 27, 2017 22:04
Rancher + Docker + Elastic Metricbeat
version: '2'
services:
<hostname>-metricbeat:
image: docker.elastic.co/beats/metricbeat:5.5.1
environment:
ES_HOST: <MY_HOST>:<MY_PORT>
network_mode: host
volumes:
- /proc:/hostfs/proc:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro