Skip to content

Instantly share code, notes, and snippets.

@CodeArtha
CodeArtha / .bugwarriorrc
Created March 24, 2019 18:13 — forked from pawamoy/.bugwarriorrc
conky porn post
[general]
targets = github_pawamoy
shorten = True
inline_links = False
annotation_links = True
annotation_comments = False
legacy_matching = False
@CodeArtha
CodeArtha / python_indentation_reminder.py
Created March 10, 2019 17:33
For all those times when I forget the best looking indentation I found for python because I don't use python often enough, courtesy of RayLuo@stackoverflow
# Indentation suggestion from RayLuo for multiline lists, dicts, and functions arguments.
my_dictionary = { # Don't think dict(...) notation has more readability
"key1": 1, # Indent by one press of TAB (i.e. 4 spaces)
"key2": 2, # Same indentation scale as above
"key3": 3, # Keep this final comma, so that future addition won't show up as 2-lines change in code diff
} # My favorite: SAME indentation AS ABOVE, to emphasize this bracket is still part of the above code block!
the_next_line_of_code() # Otherwise the previous line would look like the begin of this part of code
bad_example = {

Keybase proof

I hereby claim:

  • I am codeartha on github.
  • I am codeartha (https://keybase.io/codeartha) on keybase.
  • I have a public key ASBHngdZop5X4FGSN8Zg8ic6y5MyHrGGFVNVnCU7O-95zwo

To claim this, I am signing this object:

@CodeArtha
CodeArtha / deobfuscating-pull.sh
Last active June 11, 2021 22:18
Script to pull latest version of a repo and decrypt any files containing sensitive information for ease of use locally.
#!/bin/dash
echo "[INFO] Updating repository to latest version..."
git pull
echo "[INFO] Deobfuscating password files..."
find . -type f -name "*.pass.asc" | gpg --yes --decrypt-files
# Gets the number of files in the current directory + subdirectories that have a certain extension.
ASC=`find . -type f -name "*.asc" | wc -l`
PASS=`find . -type f -name "*.pass" | wc -l`
@CodeArtha
CodeArtha / obfuscating-commit.sh
Last active February 28, 2018 17:32
Script for making a new commit after encrypting sensitive files so that people accessing the repo can't see them if they're not supposed to.
#!/bin/dash
# Gets the number of files in the current directory + subdirectories that have a certain extension.
PASS=`find . -type f -name "*.pass" | wc -l`
ASC0=`find . -type f -name "*.asc" | wc -l`
if [ "$PASS" != 0 ]; then
# We use gpg to encrypt for ourself any file that contains password if they aren't already.
# I take as a convention in this repository to name all files I want to encrypt with the .pass extension.
# The encrypted version of said files will have the .pass.asc extension.

Keybase proof

I hereby claim:

  • I am codeartha on github.
  • I am codeartha (https://keybase.io/codeartha) on keybase.
  • I have a public key whose fingerprint is 5779 1A59 5733 4582 7EA0 A20B BC72 61D1 1B24 6E4F

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am CodeArtha on github.
  • I am codeartha (https://keybase.io/codeartha) on keybase.
  • I have a public key whose fingerprint is A5DB 63B5 D54F 3B20 229E 6424 D596 DE01 E570 2F11

To claim this, I am signing this object: