Skip to content

Instantly share code, notes, and snippets.

@ColdGrub1384
ColdGrub1384 / Battery.py
Created September 22, 2020 15:32
A battery widget for the Home Screen monitoring in background.
# Created with Pyto
import widgets as wd
import sf_symbols as sf
import sys
from datetime import time
from UIKit import UIDevice
from background import BackgroundTask
from threading import Thread
@miguelgrinberg
miguelgrinberg / .tmux.conf
Last active March 15, 2022 11:39
My .tmux.conf file for working with tmux
# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
@miguelgrinberg
miguelgrinberg / .vimrc
Last active July 1, 2024 17:11
My .vimrc configuration for working in Python with vim
" plugins
let need_to_install_plugins = 0
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
let need_to_install_plugins = 1
endif
call plug#begin()
Plug 'tpope/vim-sensible'
>>> import sys
>>> sys.setprofile(lambda *a, **k: print(a,k))
(<frame object at 0x10b2d9c18>, 'return', None) {}
(<frame object at 0x10b2e4428>, 'call', None) {}
(<frame object at 0x10b2e4428>, 'c_call', <built-in method values of dict object at 0x10bc7cfc0>) {}
(<frame object at 0x10b2e4428>, 'c_return', <built-in method values of dict object at 0x10bc7cfc0>) {}
(<frame object at 0x10b2e4428>, 'return', None) {}
>>> def add(a, b):
... return add(a+1,b) if a % 2 == 1 else a+b
...
## Useful Commands
Get kubectl version
kubectl version
Get cluster info:
@eddieantonio
eddieantonio / fabfile.py
Created September 28, 2013 01:06
Fabric: task to authorize your SSH key on a remote host.
"""
Installs your SSH key on other hosts. A fabfile for lazy people.
"""
from fabric.api import task, run, put, env, cd
# Use sh instead of bash.
env.shell = '/bin/sh -l -c'
@task