This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd | |
| cp | |
| curl/wget | |
| cut | |
| diff | |
| env | |
| find | |
| head | |
| history | |
| less |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def flatten(arr): | |
| for i in arr: | |
| if isinstance(i, list): | |
| yield from flatten(i) | |
| else: | |
| yield i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
NewerOlder