Skip to content

Instantly share code, notes, and snippets.

View isnikulin's full-sized avatar
🦍

Ivan Nikulin isnikulin

🦍
View GitHub Profile
@isnikulin
isnikulin / pwd.ps1
Created October 31, 2025 10:29
Generate secure password from terminal and automatically save to clipboard
#!/usr/bin/env pwsh
<#
.SYNOPSIS
Generates a strong random password.
Supports length, simple mode (no special chars), and JSON output.
#>
param(
[Parameter(Position = 0)]
[int]$Length = 8,
@isnikulin
isnikulin / main.go
Created March 24, 2025 03:21
Sample for simple log tracing via zerolog
package main
import (
"context"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
type traceContextKeyType int
import shutil
import base64
import sys
import os
import http.client
import urllib.parse
import json
import logging
# Url for retrieving shadowsocks configuration, allowed schemas: none, ssconf, http, https (default)
@isnikulin
isnikulin / build.gradle
Created February 9, 2022 13:15
Minimal build.gradle with jUnit 5 supporting ParameterizedTest annotation
plugins {
id 'java'
}
repositories {
mavenCentral()
}
def jUnitVersion = '5.8.2'
@isnikulin
isnikulin / bookmark.js
Created December 28, 2021 10:49
Embed youtube video via bookmark
javascript:document.location%20%3D%20'http%3A%2F%2Fwww.youtube.com%2Fembed%2F'%20%2B%20document.location.href.match(%2F%5B%26%3F%5Dv%3D(%5B%5E%26%23%5D*)%2Fi)%5B1%5D%0A%0A
@isnikulin
isnikulin / java-collections-complexity.md
Created October 19, 2021 13:46 — forked from cedricvidal/java-collections-complexity.md
Runtime Complexity of Java Collections

Below are the Big O performance of common functions of different Java Collections.

List Add Remove Get Contains Next Data Structure
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
@isnikulin
isnikulin / init.sh
Last active September 7, 2021 08:48
Duck DNS AWS ubuntu startup script
#!/bin/bash
#Adopted from https://cloudhobbyist.com/aws-vpn-2/
DDNS_DOMAIN="PUT_YOUR_DOMAIN_HERE"
DDNS_TOKEN="PUT_YOUR_API_TOKEN_HERE"
#DDNS setup
mkdir /home/ubuntu/duckdns
touch /home/ubuntu/duckdns/duck.sh
echo "#!/bin/bash