Skip to content

Instantly share code, notes, and snippets.

@dvdotsenko
dvdotsenko / .zshrc
Created December 22, 2020 18:22
Mac ZSH RC
autoload -U colors && colors
PS1="%{$fg[yellow]%}%~ %{$reset_color%}# "
CLICOLOR=1
LSCOLORS=gafacadabaegedabagacad
alias vv="source ./.venv/bin/activate"
alias ll="ls -la -G"
alias git_clean_local="git branch --merged | grep -v '\*\|master\|develop' | xargs -n 1 git branch -d"
alias git_clean_remote="git branch -r --merged | grep -v '\*\|master\|devops\|newdevops\|stable' | sed 's/origin\///' | xargs -n 1 git push --delete origin"
alias gph="git push origin HEAD"
// in console it's different.
// Enabled "Option as Meta" and
// add /0001 (CTRL A) as Home and /00005 (CTRL E) as End
// https://stackoverflow.com/questions/327664/mac-os-x-terminal-map-optiondelete-to-backward-delete-word
cd ~/Library
mkdir KeyBindings
cd KeyBindings
nano DefaultKeyBinding.dict
@dvdotsenko
dvdotsenko / google_sheets.py
Last active July 22, 2024 01:21
Python list-of-lists interface wrapper for Google Sheet API RPC. `spreadsheet['sheet name']['A1':'B2'] = [[1, 2], [3, 2]]`
# Copyright 2021-2024 Daniel Dotsenko <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
@dvdotsenko
dvdotsenko / typescript_static_initializer_collection_example.ts
Created November 22, 2024 19:59
TypeScript static initializer generic collection serialize / deserialize example with localStorage
export interface Serializable {
id: string
}
export interface SerializableStatic<T> {
new (data: Record<string, any>): T
}
export interface CollectionBase<T> {
add: (o: T) => void