Skip to content

Instantly share code, notes, and snippets.

View rosiecakes's full-sized avatar

rosie ❤ rosiecakes

  • Connecticut
View GitHub Profile
@rosiecakes
rosiecakes / import issue
Created January 19, 2017 14:37
mac osx pyodbc stupid dumb annoying issue fix
Homebrew set up to install to /Users/shimadar/usr/local instead of /usr/local
I'm running OSX 10.11.6, Python 3.5.2, pyenv 1.0.6, pyodbc 4.0.1 (via pip).
Went through [this][1] and connect fine with both tsql and isql as shown in the walkthrough.
Still cannot import pyodbc.
>>> import pyodbc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/shimadar/.pyenv/versions/3.5.2/lib/python3.5/site-packages/pyodbc.cpython-35m-darwin.so, 2): Library not loaded: /usr/local/opt/unixodbc/lib/libodbc.2.dylib
jt -t onedork -tf georgiaserif -nf droidsans -cellw 900 -lineh 150 -m 200 -cursc r -cursw 5 -T -N -f roboto -fs 12
(line height isn't great though)
@rosiecakes
rosiecakes / m.py
Last active January 9, 2017 14:40
leftover ecw reminder stuff
res_depts = []
res_depts = {d.split(' ')[0] for d in resdf['reason'] if d.split(' ')[0] not in res_depts}
# bad practice but fun
def split_results_per_dept(df):
"""Take all results, and create a dataframe for each dept
with that departments rows. Add to dictionary
"""
dept_DFS = {}
@rosiecakes
rosiecakes / main.py
Last active December 29, 2016 02:18
dataquest birth years
# convert
['2000,1,1,6,9083',
'2000,1,2,7,8006',
'2000,1,3,1,11363',
'2000,1,4,2,13032',
'2000,1,5,3,12558',
'2000,1,6,4,12466',
'2000,1,7,5,12516',
'2000,1,8,6,8934',
@rosiecakes
rosiecakes / install.rb
Last active December 6, 2016 14:05 — forked from skyl/install.rb
Homebrew without sudo
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
# SET YOUR_HOME TO THE ABSOLUTE PATH OF YOUR HOME DIRECTORY
# chmod +x install.rb
# ./install.rb
YOUR_HOME = '/Users/shimadar'
HOMEBREW_PREFIX = "#{YOUR_HOME}/usr/local"
HOMEBREW_CACHE = '/Library/Caches/Homebrew'
HOMEBREW_REPO = 'https://github.com/Homebrew/homebrew'
@rosiecakes
rosiecakes / drones.geojson
Created November 23, 2016 03:16
geojson test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rosiecakes
rosiecakes / main.md
Last active November 12, 2016 01:35
datastaxeses

Will use https://github.com/pcmanus/ccm

CCM needs 2.7, new venv and install (ccm installs pre-reqs)
mkvirtualenv -p /usr/local/bin/python2.7 datastax
pip install ccm
pip install cassandra-driver

Use this version, even though 3.9 is latest, this one is on the installation page
ccm create test -v 3.6

status_code_example = requests.get('http://api.open-notify.org/iss-pass.json').status_code
params = {'lat': 37.78, 'lon': -122.41}
response = requests.get('http://api.open-notify.org/iss-pass.json', params=params)
content = response.content
@rosiecakes
rosiecakes / main.py
Created October 29, 2016 01:17
dataquest pandas intro
column_list = food_info.columns.tolist()
gram_columns = [col for col in column_list if col.endswith('(g)')]
gram_df = food_info[gram_columns]
gram_df.head(3)
"""This is the entry point of the program."""
def _is_prime(number):
# import ipdb; ipdb.set_trace()
for n in range((number - 1), 1, -1):
if number % n == 0:
return False
return True