Skip to content

Instantly share code, notes, and snippets.

View Dainerx's full-sized avatar
💨

Oussama Ben Ghorbel (Dainerx) Dainerx

💨
View GitHub Profile
@nextrevision
nextrevision / deleteJenkinsJobs.groovy
Created December 3, 2015 17:30
Groovy script to delete all jenkins jobs that match a regex pattern
import jenkins.model.*
def matchedJobs = Jenkins.instance.items.findAll { job ->
job.name =~ /my_regex_here/
}
matchedJobs.each { job ->
println job.name
//job.delete()
}

Preview

Preview

Installation

smashing install bc4014fa61f08b31f3d42a5e78c49d9b

Configuration

  • ratp.scss: adjust background-color and font-size to your preference.
  • ratp.rb: configure with the desired stops and directions.
@nadavrot
nadavrot / Matrix.md
Last active July 21, 2024 17:27
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@YumaInaura
YumaInaura / 00_README.md
Last active June 9, 2024 17:39
Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

I was so confused to understand behaviior of Golang channels, buffer, blocking, deadlocking and groutines.

I read Go by Example topics.

@alexrqs
alexrqs / loadUniqueScripts.js
Last active September 4, 2019 12:39
How to load only one time even if the script is required multiple times, and how to check or detect if the script is loaded.
// keep track of the loaded libraries
const loadedLibraries = []
function registerLibraryLoaded(id) {
// record the libs only if the array doesn't contain the same already
if (loadedLibraries.indexOf(id) < 0) {
loadedLibraries.push(id)
}
}
@Toparvion
Toparvion / HOWTO.md
Last active May 23, 2024 02:35
JUnit test for conditional Spring Boot bean registration (@ConditionalOnProperty)

Problem

Suppose you have two classes that should be registered with Spring context exclusively, e.g. only one of the beans must exist in the context at any time based on some boolean property value. Of course you can do it by adding explicit if condition into your @Configuration class. But if the classes have no common interface it may be quite cumbersome. As an alternative you can use @ConditionalOnProperty annotation on your classes, e.g.:

@Service
@ConditionalOnProperty(name = "use-left-service", havingValue = "true", matchIfMissing = false)
public class LeftService
@Nezz7
Nezz7 / ls.go
Last active November 11, 2020 19:31
Unix ls command go implementation
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"sort"