Skip to content

Instantly share code, notes, and snippets.

Dave Evans evansde77

  • Aurora, IL
Block or report user

Report or block evansde77

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 Recipe.md

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
View gist:35159c2c17471b8e080b41eef7e145c2
(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
View gist:a139aaf2ce0b173fe02b9ec3a0ca64b2
from contextlib import contextmanager
@contextmanager
def context1(arg):
print("Bronte")
yield "Tolkien"
print(arg)
@evansde77
evansde77 / mac_install_hdfs3.sh
Created Jul 5, 2017
Installation steps to install hdfs3 and underlying libhdfs3 on a Mac
View mac_install_hdfs3.sh
#
# 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 Mar 20, 2019
Example bash command to show current branch in shell prompt that can be added to bashrc/bash_profile
View git_branch_prompt.sh
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 Mar 12, 2020
Example of mocking requests calls
View mock_requests.py
#!/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 Jan 21, 2019
examples of performing mock.patch actions in three different but equivalent ways
View mock_examples.py
#!/usr/bin/env python
"""
mock examples
"""
import os
import unittest
import mock
import functools
@evansde77
evansde77 / format_pandas_df_html.py
Created Jul 12, 2016
Formatting Pandas HTML to add styles example
View format_pandas_df_html.py
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
You can’t perform that action at this time.