Skip to content

Instantly share code, notes, and snippets.

View okeeffdp's full-sized avatar

Daniel O'Keeffe okeeffdp

  • Dropbox
  • Dublin, Ireland
View GitHub Profile
@okeeffdp
okeeffdp / vscode_extensions.txt
Last active December 8, 2021 12:17
A list of the vscode extensions that I use.
2gua.rainbow-brackets
akamud.vscode-theme-onelight
alexcvzz.vscode-sqlite
CoenraadS.bracket-pair-colorizer-2
eamodio.gitlens
hangxingliu.vscode-nginx-conf-hint
josephtbradley.hive-sql
koszti.snowflake-driver-for-sqltools
mechatroner.rainbow-csv
mohsen1.prettify-json
@okeeffdp
okeeffdp / python.json
Created August 6, 2021 11:36
VSCode python script boilerplate snippet
{
// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"script_boilerplate": {
"prefix": "boilerplate",
"body": [
"",
@okeeffdp
okeeffdp / backoff_expo_request_example.py
Created March 31, 2021 16:41
An example script that can be used for testing how backoff works.
import random
import backoff
from requests.exceptions import HTTPError
@backoff.on_exception(
backoff.expo,
HTTPError,
@okeeffdp
okeeffdp / get_size.sh
Last active December 7, 2020 18:00
Figure out where all your storage space is being used with this handy little alias function for the bash du function.
function get_size {
# Search in directory $1 with a depth of $2, default 1.
sudo du -h -d ${2:-1} "$1" 2> /dev/null;
}
@okeeffdp
okeeffdp / Hive.sublime-settings
Last active August 17, 2020 10:48
Change hive spacing to two spaces and add *.snowql as an extension. Place in '~/Library/Application Support/Sublime Text 3/Packages/User' directory.
{
"extensions": [
"snowql"
],
"tab_size": 2
}
@okeeffdp
okeeffdp / ssfind.sh
Created November 11, 2019 11:20
It's `find` but with less typing.
function ssfind {
# Simple Find
BEGIN_PATH="${2:-/}";
echo "Searching for $1 in $BEGIN_PATH";
sudo find "$BEGIN_PATH" -name "$1" 2> /dev/null;
}
@okeeffdp
okeeffdp / stitch.sh
Created March 14, 2019 11:43
Stitch - A shortcut for writing Apache Yarn Application Logs to a file.
# Usage
# $ stitch applicationID [outputFile]
# Example
# $ stitch application_1550651372554_2211111
function stitch() {
yarn logs -applicationId $1 > ${2:-app.log}
}
@okeeffdp
okeeffdp / sublime_sidebar_icon_change_howto.md
Created January 29, 2019 17:21
HOWTO: Change icons in Sidebar of Sublime Text 3

HOWTO: Changing Sidebar Icons

This is written with the Seti_UI package installed.

Navigate to the Sublime Text 3/Packages/Seti_UI/icons/ directory.
If a image file (.png) already exists for your new file extension, then copy the Prefs/icon_<existing_filetype>.tmPreferences replacing the current existing_filetype with the new filetype name.
In the file change the scope and the string to match the existing filetype.

@okeeffdp
okeeffdp / hgrep.sh
Created August 20, 2018 13:59
A grep function for searching the hisotry file
'''
Add the function to you .bashrc or .bash_profile
To use simply type hgrep and any commands you would normally pass to grep.
For example,
```bash
$ hgrep wc
54 wc -l
$ hgrep -c ssh
74
@okeeffdp
okeeffdp / ispark.md
Last active January 18, 2018 10:41
A quick guid to using ipython with pyspark

Firstly, go to the https://conda.io/miniconda.html website and download the latest version of miniconda for your OS.

The python version shipped with miniconda does not need to be the same version as the one currently installed on your OS. However, it is recommended that they be the same. This will prevent bugs from arising during development should you switch between python interpreters.

Miniconda is preferred over Anaconda because of its size. With Miniconda, the required packages can be installed as needed.

To begin, from the website copy the link to the miniconda version of choice and follow the install guide provide by Continuum.