Skip to content

Instantly share code, notes, and snippets.

Bryan Lott bryan-lott

Block or report user

Report or block bryan-lott

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am bryan-lott on github.
  • I am bryanlott (https://keybase.io/bryanlott) on keybase.
  • I have a public key whose fingerprint is 49F8 B969 D780 8AAF 9D4D 56EF 5F23 2B86 00FE 4BB5

To claim this, I am signing this object:

@bryan-lott
bryan-lott / move.py
Created Jul 13, 2018
Move files from one folder to another
View move.py
import shutil
import os
src = 'source'
dst = 'destination'
for f in os.listdir(src):
shutil.move(os.path.join(src, f), dst)
@bryan-lott
bryan-lott / dict_map_bools_to_strings.py
Created Feb 28, 2018
python dict mapping bools to strings
View dict_map_bools_to_strings.py
bool_val = True
result = {True: 'IS', False: 'IS NOT'}[bool_val]
print("Mapping {} awesome".format(result))
View gist:66aa1a9675b50356890337a61ffab985
DavidAnson.vscode-markdownlint-0.7.2
lei.theme-chromodynamics-1.0.8
HookyQR.beautify-1.0.2
lukehoban.go-0.6.61
PeterJausovec.vscode-docker-0.0.14
mohsen1.prettify-json-0.0.3
RoscoP.ActiveFileInStatusBar-1.0.2
ms-vscode.sublime-keybindings-2.0.1
Stephanvs.dot-0.0.1
mushan.vscode-open-iterm2-0.0.2
View gist:fb767f51d81aeb3236f0ed8d5790fb5f
Parinfer
go-outline
multi-cursor
go-plus
nord-atom-syntax
Sublime-Style-Column-Selection
go-signature-statusbar
nord-atom-ui
ariake-dark-syntax
highlight-line
View argparse_reminder.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="""
I never freaking remember argparse syntax and the docs are so all over the place
that I need this for an example.
@bryan-lott
bryan-lott / redshift_example_using_psycopg2.py
Created Oct 27, 2015
Example on how to connect to redshift using psycopg2
View redshift_example_using_psycopg2.py
__author__ = 'fbaldo'
import psycopg2
import pprint
configuration = { 'dbname': 'database_name',
'user':'user_name',
'pwd':'user_password',
'host':'redshift_endpoint',
View useful_pandas_snippets.py
#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
View _vimrc
if has('win32') || has('win64')
set runtimepath=$HOME/_vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/_vim/after
endif
" Usability & Appearance Options
filetype plugin indent on
syntax enable
" Turn on line numbering (turn off with "set nonu")
set nu
View Default (Windows).sublime-keymap
[
{ "keys": ["ctrl+,"], "command": "jump_back" },
{ "keys": ["ctrl+."], "command": "jump_forward" },
{ "keys": ["ctrl+o"], "command": "fuzzy_start_from_file" },
{ "keys": ["ctrl+shift+o"], "command": "fuzzy_bookmarks_load" },
{ "keys": ["f5"], "command": "revert_file"}
]
You can’t perform that action at this time.