This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Not sure where this came from, but I suspect | |
it was from a python talk about making beautiful | |
code.""" | |
from contextlib import contextmanager | |
@contextmanager | |
def ignored(*exceptions): | |
"""Ignore a provided list of exceptions.""" | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""I believe that this snippet of code | |
came from somewhere on stackoverflow.""" | |
from __future__ import print_function | |
import sys, time | |
class ProgressBar: | |
def __init__(self, iterations): | |
self.iterations = iterations | |
self.prog_bar = '[]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'fbaldo' | |
import psycopg2 | |
import pprint | |
configuration = { 'dbname': 'database_name', | |
'user':'user_name', | |
'pwd':'user_password', | |
'host':'redshift_endpoint', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import os | |
import sys | |
import subprocess | |
import signal | |
import threading | |
import time | |
import ltmain | |
def noop(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wx | |
print(wx.version()) | |
import wx.lib | |
from wx.lib.floatcanvas import NavCanvas | |
app = wx.App(0) | |
wx.InitAllImageHandlers() | |
frame_1 = wx.Frame(None, wx.ID_ANY, "") | |
app.SetTopWindow(frame_1) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{ "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"} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; User keymap | |
;; ----------------------------- | |
;; Modify this file to add and subtract keybindings (keyboard shortcuts). | |
;; Keybindings allow custom keys to invoke any desired LightTable functionality that is behind a command. | |
;; A keybinding has the following format: | |
;; | |
;; [:TAG "KEYS" :COMMAND] | |
;; | |
;; * A tag indicates in what context the keybinding applies. Common tags are :app and :editor which respectively | |
;; indicate the keybinding can be used anywhere and the keybinding can only be used when editing text. |
OlderNewer