Skip to content

Instantly share code, notes, and snippets.

View panki's full-sized avatar
🏠
Working from home

Alexander Panko panki

🏠
Working from home
View GitHub Profile
@panki
panki / sealed_secrets.sh
Created October 25, 2023 00:40
Query sealed secrets from kubernetes cluster
#!/bin/bash
while [[ "$#" -gt 0 ]]; do
case $1 in
-n|--namespace)
NAMESPACE="$2"
shift
;;
-s|--secret)
SECRET_NAME="$2"
@panki
panki / diff.sh
Created September 12, 2023 17:27
Git diff with line numbers
git diff HEAD^ HEAD | awk '
/^@@/ {
gsub(/@@|\+|\-|@@/, "", $0);
split($1, old, ",")
split($2, new, ",")
old_line = old[1]
new_line = new[1]
next
}
{
package com.nuvoair.web.rest
import com.nuvoair.common.security.*
import com.nuvoair.security.jwt.MagicTokenProvider
import com.nuvoair.service.NuvoairUserService
import com.nuvoair.service.OnboardService
import com.nuvoair.utils.UrlBuilder
import com.nuvoair.web.rest.viewmodel.OnboardCompleteRequest
import com.nuvoair.web.rest.viewmodel.ValidateTokenRequest
import com.nuvoair.web.rest.viewmodel.ValidateTokenResponse
from itertools import product
from typing import List, Tuple
def __find_neighbours(x: int, y: int, size: int) -> List[Tuple]:
"""
Finds neighbours for a cell. Those which fall out of the field are skipped
:param x: current cell's X coord
:param y: current cell's Y coord
:param size: field single dimension size (because field is square)
@panki
panki / split.go
Created May 24, 2022 04:15
ffmpeg split & convert
package ffmpeg
import (
"fmt"
"os"
"regexp"
"strings"
"github.com/gofrs/uuid"
)
package main
import (
"fmt"
"os"
"sort"
)
func getMedian(array1 []uint32, array2 []uint32) uint32 {
// O(n/2) solution with optimization for edge cases
package main
import "fmt"
func PrefixSum(my_array,my_output []int ,parent chan int) {
if len(my_array)<2{
parent<-my_array[0]
my_output[0] = my_array[0] + <-parent
}else if len(my_array)<1{
parent<-0
@panki
panki / main.go
Created May 28, 2020 14:26
1370. Increasing Decreasing String
// https://leetcode.com/problems/increasing-decreasing-string/
import "strings"
func sortString(s string) string {
counts := make([]int, 26)
for _, c := range s {
counts[int(c - 'a')] += 1
}
@panki
panki / working.py
Created May 11, 2020 22:58
Palindrome checker
# * palindrome checker
# "aba"
# "racecar"
# "a_* b?a"
# "Aba"
from string import ascii_lowercase
def check(s):

Keybase proof

I hereby claim:

  • I am panki on github.
  • I am panki61 (https://keybase.io/panki61) on keybase.
  • I have a public key ASC1ghbS3OxOTgC1IBCVmihQK_euwHPkMOQbLG4T08Hh0wo

To claim this, I am signing this object: