Skip to content

Instantly share code, notes, and snippets.

View WritingPanda's full-sized avatar
🐼
Just a panda

Leonardo Quimbaya WritingPanda

🐼
Just a panda
  • GitHub Staff
  • San Antonio, TX
  • 00:15 (UTC -05:00)
  • LinkedIn in/leoquimbaya
View GitHub Profile
@WritingPanda
WritingPanda / .env
Last active September 12, 2024 00:10
Script to get all repos with CodeQL compatible languages
GITHUB_TOKEN=YOUR TOKEN HERE
@WritingPanda
WritingPanda / yaml-to-csv.py
Last active August 15, 2024 21:16
Change a YAML file to a CSV file
# Change https://github.com/github/docs/blob/main/src/secret-scanning/data/public-docs.yml to a CSV
import yaml
import csv
from datetime import datetime
def load_yaml_file(filename: str) -> list:
with open(filename, "r") as stream:
try:
@WritingPanda
WritingPanda / delombok.sh
Created April 26, 2023 14:16
Delombok a Java project to prepare for CodeQL scans
# get a copy of lombok.jar
wget https://projectlombok.org/downloads/lombok.jar -O "lombok.jar"
# run "delombok" on the source files and write the generated files to a folder named "delombok"
java -jar "lombok.jar" delombok -n --onlyChanged . -d "delombok"
# remove "generated by" comments
find "delombok" -name '*.java' -exec sed '/Generated by delombok/d' -i '{}' ';'
# remove any left-over import statements
find "delombok" -name '*.java' -exec sed '/import lombok/d' -i '{}' ';'
# copy delombok'd files over the original ones
cp -r "delombok/." "./"
@WritingPanda
WritingPanda / logging_config.py
Created December 27, 2022 21:33
Basic Configuration for logging in Python
import logging
logging.basicConfig(
filename='application.log',
level=logging.WARNING,
format='[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s',
datefmt='%H:%M:%S'
)
@WritingPanda
WritingPanda / projects.sh
Last active January 3, 2020 21:19
Lists all of my projects in the projects directory and cds to the one I want
#!/bin/bash
function projects() {
# or wherever your project directory is located
DIRS=(/mnt/f/Projects/*)
select dir in "${DIRS[@]}"
do
cd "${dir}"
@WritingPanda
WritingPanda / python-pyenv-dev-env-build.sh
Created January 3, 2020 19:58
Get dependencies for python development and install pyenv
# on ubuntu
sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
# on fedora
sudo dnf install zlib-devel bzip2 bzip2-devel readline-devel sqlite \
sqlite-devel openssl-devel xz xz-devel libffi-devel findutils
# install pyenv
@WritingPanda
WritingPanda / bash-prompt-command-python-version.sh
Last active January 2, 2020 21:31 — forked from dmendiza/gist:6709874
Show the active python version in pyenv before every prompt
# Show the version inline
export PROMPT_COMMAND='echo -n [python:$(pyenv version-name)]'
# Show the version name in light green on previous line
export PROMPT_COMMAND='echo -e "\033[1;32m[python:$(pyenv version-name)]\033[0m"'
@WritingPanda
WritingPanda / gist:f5506dcfa29c73ec885088ee55fbac90
Created December 26, 2017 16:14
Blockstack ID verification
Verifying my Blockstack ID is secured with the address 17Vwy9hfEqHEs8CBS5vZJ7XgW5K3H7odZK https://explorer.blockstack.org/address/17Vwy9hfEqHEs8CBS5vZJ7XgW5K3H7odZK

Keybase proof

I hereby claim:

To claim this, I am signing this object: