Skip to content

Instantly share code, notes, and snippets.

View lsloan's full-sized avatar

Mr. Lance E Sloan «UMich» lsloan

  • Teaching and Learning (@tl-its-umich-edu) at University of Michigan: Information and Technology Services
  • Ann Arbor, Michigan, USA
  • 14:55 (UTC -04:00)
  • X @lsloan_umich
View GitHub Profile
@gdcutting
gdcutting / google-bigquery-getting-started.ipynb
Last active June 17, 2022 00:32
Google BigQuery: Getting Started
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@felipou
felipou / decrypt_dbeaver.py
Last active May 14, 2024 22:14
DBeaver password decryption script - for newer versions of DBeaver
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection
# requires pycryptodome lib (pip install pycryptodome)
import sys
import base64
import os
import json
from Crypto.Cipher import AES
@joshlk
joshlk / trio_progress_bar.py
Created May 31, 2019 13:58
Progress bar for Python Trio tasks using tqdm
import trio
import tqdm
class TrioProgress(trio.abc.Instrument):
def __init__(self, total, notebook_mode=False, **kwargs):
if notebook_mode:
from tqdm import tqdm_notebook as tqdm
else:
from tqdm import tqdm
@skyzyx
skyzyx / homebrew-gnubin.md
Last active April 24, 2024 00:04
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@bittner
bittner / keyboard-keys.md
Created February 28, 2019 22:50
Keyboard keys markup in MarkDown

Ctrl + Alt + Space

@felipou
felipou / decrypt_dbeaver.py
Last active January 24, 2024 14:11
DBeaver password decryption script
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection
import sys
import base64
print(sys.argv[1])
PASSWORD_ENCRYPTION_KEY = b"sdf@!#$verf^wv%6Fwe%$$#FFGwfsdefwfe135s$^H)dg"
@0x4a616e
0x4a616e / .vimrc
Last active August 23, 2023 02:35
MacVim Touch Bar buttons
" MacVim Touch Bar support
" ========================
" Since version 8.0 (I think), MacVim natively supports the macOS touch bar. By default it just contains
" one button to toggle fullscreen mode. To add some more useful buttons, just copy this into your .vimrc
"
" More details about the syntax can be found here: https://github.com/macvim-dev/macvim/blob/master/runtime/doc/gui_mac.txt
" For a list of touch bar image names, see https://developer.apple.com/design/human-interface-guidelines/macos/touch-bar/touch-bar-icons-and-images/
" Toggle NerdTree
@chetanppatil
chetanppatil / set-dbeaver-timezone-to-UTC.md
Last active December 19, 2023 01:34
Set dbeaver timezone to UTC (default timezone)

For Linux Users

  1. Go to directory: /usr/share/dbeaver
  2. Edit dbeaver.ini file
  3. In that file add -Duser.timezone=UTC this line under -vmargs tag
  4. Save it and restart dbeaver.
  5. Enjoy with correct date without any date conversion.

Finally your dbeaver.ini file will look like this:

#!/bin/sh --
# delete pods that have a status of "Completed" or "Error"
oc get pods | tail -n +2 | awk '($3 == "Completed" || $3 == "Error") {print $1}' | xargs -I% -L1 oc delete pod/%
FROM cern/cc7-base
# Install required packages
RUN yum -y install \
bzip2 \
git \
kernel-devel \
libcurl-openssl-devel \
libffi-devel \
ncurses-devel \