Skip to content

Instantly share code, notes, and snippets.

View antimirov's full-sized avatar
🇺🇦

Yevgen Antymyrov antimirov

🇺🇦
View GitHub Profile
#!/usr/bin/env python3
"""
Antigravity to Antigravity IDE Migration Tool
==============================================
A self-contained script to automatically migrate extensions, custom settings, keybindings,
snippets, workspace states, and entire conversation histories from Antigravity v1
to the new Antigravity IDE.
Author: Antigravity AI Coding Assistant (pair-programmed with USER)
License: MIT
@antimirov
antimirov / stages_of_bash.txt
Created April 1, 2020 12:43
6 Stages of Bash
6 Stages of Bash:
1. Let’s quickly make it in bash
2. How to do <…> in Bash, I should have done it in Python instead
3. Fuck it, I’ll just redo it in Python
4. Fuck it, how to combine xargs and subprocess?
5. Fuck it, I’ll just redo it in Bash
6. “#!/bin/bash\nTODO: rewrite it in something else"
@antimirov
antimirov / parse_dotenv.bash
Created March 24, 2020 17:06 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
def gen_dict_extract(key, var, path=None):
if path is None:
path = []
if hasattr(var, "items"):
for k, v in var.items():
if k == key:
yield v, path + [k]
if isinstance(v, dict):
for result, _path in gen_dict_extract(key, v, path + [k]):
yield result, _path
@antimirov
antimirov / commands.txt
Last active July 23, 2019 09:30
Shell commands to know - a minimal set
cd
cp
curl/wget
cut
diff
env
find
head
history
less
@antimirov
antimirov / flatten.py
Created May 3, 2019 09:56
Flatten a python list of arbitrary nesting
def flatten(arr):
for i in arr:
if isinstance(i, list):
yield from flatten(i)
else:
yield i
@antimirov
antimirov / get_cert.sh
Created April 5, 2019 13:57 — forked from SaltwaterC/get_cert.sh
get_cert
function get_cert()
{
local host="$1"
local port="$2"
if [ -z "$port" ]
then
port="443"
fi
openssl s_client -showcerts -connect $host:$port -servername $host </dev/null 2>/dev/null | openssl x509 -text -noout
@antimirov
antimirov / seeker.c
Created March 18, 2019 16:28
seeker.c - HDD/SSD random access speed test
/*
* How far is your dist?
*
* From: http://www.linuxinsight.com/how_fast_is_your_disk.html
*/
#define _LARGEFILE64_SOURCE
#include <stdio.h>
#include <stdlib.h>
@antimirov
antimirov / 30-income-calculon.pl
Created January 13, 2016 09:05 — forked from avar/30-income-calculon.pl
Calculate your income in The Netherlands with and without a 30% ruling.
# To check if this is up-to-date with the tax rates go to
# http://www.expatax.nl/tax-rates-2015.php and see if there's anything
# newer there.
#
# I make no guarantees that any of this is correct. I calculated this
# at the time and have been updating it when new tax rates come along
# because people keep finding this useful.
#
# There's also an interactive JS version of this created by
# @stevermeister at
import SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all circumstances), or