Skip to content

Instantly share code, notes, and snippets.

@ArisAgnew
ArisAgnew / Big_O_Performance.md
Last active April 16, 2021 09:40
Big O performance

Big O performance of common functions of different Java Collections.

List Add Remove Get/Read Contains Next Data Structure
[] O(n) O(n) O(1) O(n) O(1) Array
List O(1)* O(n) O(n) O(n) O(1) Array
ArrayList O(1) O(n) O(1) O(n) O(1) Array
LinkedList O(1) O(1) O(n) O(n) O(1) Linked List
CopyOnWriteArrayList O(n) O(n) O(1) O(n) O(1) Array
@aimtiaz11
aimtiaz11 / timer-vars.md
Last active August 2, 2024 01:13
Adding Timer Variables in Mule Flows

Adding Timer Variables in Mule Flows

Adding timer variables in Mule flows to check for performance bottlenecks.

Setting Timer Variable set-variable

<set-variable value="#[%dw 2.0 import currentMilliseconds from dw::util::Timer --- currentMilliseconds()]" 
              variableName="http_before" doc:name="http_before" mimeType="application/java"/>
@aimtiaz11
aimtiaz11 / curl.sh
Last active February 26, 2025 08:12
Curl - Echo only HTTP status
curl -Iso /dev/null -w "%{http_code}\n" -k https://www.google.com.au
@aimtiaz11
aimtiaz11 / compare-list.groovy
Last active September 13, 2023 14:47
Helpful Groovy Scripts
/**
* Usage: groovy compare-list.groovy first.txt second.txt
**/
def sourceList = []
new File( args[0] ).eachLine { line ->
sourceList << line.trim()
}
@aimtiaz11
aimtiaz11 / readme.md
Last active March 7, 2024 04:58 — forked from thomasdarimont/readme.md
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Decoding a JWT Payload with your Shell (bash, zsh...)

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
 fi