Skip to content

Instantly share code, notes, and snippets.

@andriitishchenko
andriitishchenko / Examples.md
Last active April 30, 2024 03:50
Swift + graphQL

Query:

{
  authorById(id: 1) {
    id
    firstName
    lastName
    posts {
      id
 title
@andriitishchenko
andriitishchenko / Swift gRPC.md
Last active April 26, 2024 22:54
Swift gRPC + Python server

alt text

install protoc , protoc-gen-swift , protoc-gen-grpc-swift

brew install protobuf swift-protobuf grpc-swift grpcurl

Use examples

git clone --depth 1 --filter=blob:none --sparse https://github.com/grpc/grpc
@andriitishchenko
andriitishchenko / StadiaSWCC-c843.cfg
Created April 21, 2024 08:36
Stadia Gamepad Controller raspberry configs
input_device = "StadiaSWCC-c843"
input_driver = "udev"
input_enable_hotkey_btn = "12"
input_r3_btn = "10"
input_r_y_minus_axis = "-3"
input_l_btn = "4"
input_load_state_btn = "4"
input_r_y_plus_axis = "+3"
input_up_btn = "h0up"
input_left_btn = "h0left"
# "/opt/retropie/configs/all/retroarch-joypads/DragonRise Inc. Generic USB Joystick .cfg"
# Open config menu and enable analog controll
input_device = "DragonRise Inc. Generic USB Joystick "
input_driver = "udev"
input_r_y_minus_axis = "-4"
input_r_y_plus_axis = "+4"
input_r_x_plus_axis = "+3"
@andriitishchenko
andriitishchenko / remove.mail.attachments.sh
Created November 12, 2023 07:39
remove.mail.attachments.sh
# replase "echo" to rm -rf
find ~/Library/Mail/ -name "*.*" -type f | grep "/Attachments/" | while read -r line; do echo "$line"; done
Preparing "Install Android SDK Build-Tools 34 v.34.0.0".
Downloading https://dl.google.com/android/repository/build-tools_r34-macosx.zip
"Install Android SDK Build-Tools 34 v.34.0.0" ready.
Installing Android SDK Build-Tools 34 in /Users/<YOU_USER>/Library/Android/sdk/build-tools/34.0.0
Packages to install: - Android SDK Command-line Tools (latest) (cmdline-tools;latest)
Preparing "Install Android SDK Command-line Tools (latest) v.11.0".
Downloading https://dl.google.com/android/repository/commandlinetools-mac-10406996_latest.zip
"Install Android SDK Command-line Tools (latest) v.11.0" ready.
Installing Android SDK Command-line Tools (latest) in /Users/<YOU_USER>/Library/Android/sdk/cmdline-tools/latest
@andriitishchenko
andriitishchenko / gen_icon.sh
Created June 11, 2023 06:12
Icon generator script for custom icon sizes
#!/bin/sh
#
# Usage :
# ./gen_icon.sh images/icon-512.png "icon-" "10 25"
# Output:
# out_icons/icon-10.png
# out_icons/icon-25.png
source_image="$1"
@andriitishchenko
andriitishchenko / regex_words_ignore.md
Last active May 19, 2023 20:03
regex example words ignoring

"\b(?!id|lat|lon|name|species).+"\b.+

   {

        "id": 5780529316,        <--- skip
        "lat": 51.0364421,       <--- skip
        "lon": -114.0614200,     <--- skip
        "historic": "memorial",
        "inscription": "Pte John George Pattison V.C.\nCitation",

"memorial": "plaque",

@andriitishchenko
andriitishchenko / terget.c
Created March 15, 2023 13:21
XProtect test
/**
https://yara.readthedocs.io/en/stable/commandline.html
$ clang terget.c
$ brew install yara
$ yara /Library/Apple/System/Library/CoreServices/XProtect.bundle/Contents/Resources/XProtect.yara terget.out
XProtect_MACOS_644e18d terget.out
@andriitishchenko
andriitishchenko / AMT_tools.md
Created March 15, 2023 11:54
Check Versions of Anti Malware Tools for macOS

Gatekeeper

$ /usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" /private/var/db/gkopaque.bundle/Contents/Info.plist

XProtect

$ defaults read /Library/Apple/System/Library/CoreServices/XProtect.bundle/Contents/Info.plist CFBundleShortVersionString