Skip to content

Instantly share code, notes, and snippets.

View evansde77's full-sized avatar

Dave Evans evansde77

View GitHub Profile
@evansde77
evansde77 / Gumbo.txt
Created December 13, 2020 21:43
Gumbo
Gumbo
Ingredients:
6 Cajun style andouille sausages or smoked sausage or mix
4 boneless skinless chicken thighs
1 lb raw shrimp, peeled, deveined, chopped
1 cups flour
1/2 cup peanut oil
@evansde77
evansde77 / Recipe.md
Created February 23, 2020 14:42
Gumbo recipe

Ingredients

  • 4 Cajun style andouille sausages
  • 6 boneless skinless chicken thighs
  • 1 lb raw shrimp, peeled, deveined, chopped
  • 2 cups flour
  • 1 cup peanut oil
  • 1 cup canola oil
  • 2 onions
  • 2 green bell peppers
(base) root@0343625ee20e:/opt/unicron/imc-unicron-jupyter# conda list
# packages in environment at /opt/conda:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
asn1crypto 1.0.1 py37_0
attrs 19.2.0 py_0
backcall 0.1.0 py37_0
bleach 3.1.0 py37_0
ca-certificates 2019.8.28 0
from contextlib import contextmanager
@contextmanager
def context1(arg):
print("Bronte")
yield "Tolkien"
print(arg)
@evansde77
evansde77 / mac_install_hdfs3.sh
Created July 5, 2017 21:15
Installation steps to install hdfs3 and underlying libhdfs3 on a Mac
#
# required downloading source of cmakem protobuf, gsasl as well as hdfs3
#
mv ~/Downloads/cmake-3.9.0-rc5.tar.gz .
tar -zxf cmake-3.9.0-rc5.tar.gz
cd cmake-3.9.0-rc5
./bootstrap && make
sudo make install
@evansde77
evansde77 / git_branch_prompt.sh
Last active March 20, 2019 18:08
Example bash command to show current branch in shell prompt that can be added to bashrc/bash_profile
function parse_git_branch ()
{
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
BRANCH="("${ref#refs/heads/}")";
echo "${BRANCH}"
}
export PS1="[\t \W] \$(parse_git_branch) "
@evansde77
evansde77 / mock_requests.py
Last active January 31, 2024 08:49
Example of mocking requests calls
#!/usr/bin/env python
"""
mocking requests calls
"""
import mock
import unittest
import requests
from requests.exceptions import HTTPError
@evansde77
evansde77 / mock_examples.py
Last active September 9, 2020 15:21
examples of performing mock.patch actions in three different but equivalent ways
#!/usr/bin/env python
"""
mock examples
"""
import os
import unittest
import mock
import functools
@evansde77
evansde77 / format_pandas_df_html.py
Created July 12, 2016 19:17
Formatting Pandas HTML to add styles example
import pandas
import numpy
# random data with columns A, B, C, D
df = pandas.DataFrame(numpy.random.randn(50, 4), columns=list('ABCD'))
#
# style helpers