Skip to content

Instantly share code, notes, and snippets.

@legege
legege / cleanup.groovy
Created March 23, 2018 16:41
Intelligently clean a Sonatype Nexus3 repository... keep the last X released versions of each "major.minor" artifact
import org.sonatype.nexus.repository.storage.Component
import org.sonatype.nexus.repository.storage.StorageFacet;
def retentionCount = 15
def repositoryName = 'releases'
def dryRun = true
log.info("Cleanup script started! Dry Run Mode: $dryRun");
def repo = repository.repositoryManager.get(repositoryName);
def tx = repo.facet(StorageFacet.class).txSupplier().get();
@robertklep
robertklep / dabblet.css
Created February 23, 2013 20:06
European Energy Label in CSS
/**
* European Energy Label in CSS
*/
.energy-class {
position: relative;
width: 155px;
font-family : sans-serif;
}
.energy-class span {
@ammuench
ammuench / 8BitDoUltimateWifi_Linux.MD
Last active May 6, 2024 20:54
8BitDo Ultimate 2.4GHz wifi working in linux
@gbuela
gbuela / NavViewDemo
Created February 9, 2020 03:14
Custom navigation bar in SwiftUI
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
ZStack {
Color.black
.edgesIgnoringSafeArea([.all])
NavigationLink(destination: ContentView2()) {
Text("push")
@th3at0m
th3at0m / kms.md
Last active May 6, 2024 20:54
KMS Keys/Product Keys for Windows/Windows Server

Here, you can find the Product Keys for activating Windows.

Warming: This won't work with Home editions. Please first update to Professional edition if you want to activate Windows.

How do I activate Windows?

  1. Search for "Command Prompt" in the search box
  2. Right Click on the Command Prompt entry
  3. Press "Run as Administrator", then press yes.
  4. Type these commands one by one:
@hjbotha
hjbotha / free_ports.sh
Last active May 6, 2024 20:53
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6 - 7.0.1. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Edit it according to your requirements
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx
@adrianhajdin
adrianhajdin / ProfileMenu.tsx
Last active May 6, 2024 20:53
Build and Deploy a Full Stack Next.js 13 Application | React, Next JS 13, TypeScript, Tailwind CSS
"use client"
import Link from "next/link";
import Image from "next/image";
import { signOut } from "next-auth/react";
import { Fragment, useState } from "react";
import { Menu, Transition } from "@headlessui/react";
import { SessionInterface } from "@/common.types";
@Dascr32
Dascr32 / cst.bat
Created August 4, 2015 17:25
Simple batch script that test your internet connection. It tells the number and time of disconnections. Also creates a log file in the c:/ drive with all the events.
@Echo off
title Connection Stability Test / Dascr32
cls
set /A disconnections=1
echo Start time:
time/t
echo ============================================ >> c:\cstb-log.txt
@pjlsergeant
pjlsergeant / selfgol.pl
Created July 9, 2012 13:36
Damien Conway's Selfgol
#!/usr/local/bin/perl -sw
$;=$/;seek+DATA,!++$/,!$s;$_=<DATA>;$s&&print||$g&&do{$y=($x||=20)*($y||8);sub
i{sleep&f}sub'p{print$;x$=,join$;,$b=~/.{$x}/g}$j=$j;sub'f{pop}sub
n{substr($b,&f%$y,3)=~tr,O,O,}sub'g{$f=&f-1;($w,$w,substr($b,&f,1),O)[n($f-$x)+
n($x+$f)-(substr($b,&f,1)eq+O)+n$f]||$w}$w="\40";$b=join'',@ARGV?<>:$_,$w
x$y;$b=~s).)$&=~/\w/?O:$w)ge;substr($b,$y)=q++;$g='$i=0;$i?$b:$c=$b;
substr+$c,$i,1,g$i;$g=~s?\d+?($&+1)%$y?e;$i-$y+1?eval$g:do{$i=-1;$b=$c;p;i
1}';sub'e{eval$g;&e}e}||eval||die+No.$;
__DATA__
if($j){{$^W=$|;*_=sub{$=+s=#([A-z])(.*)#=#$+$1#=g}}
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active May 6, 2024 20:49
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"