Skip to content

Instantly share code, notes, and snippets.

@aok1425
aok1425 / querying_sql_example.ipynb
Created September 11, 2019 22:34
Example of how to query data using SQL in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
sudo add-apt-repository -y ppa:wine/wine-builds
sudo apt update
sudo apt install winehq-devel winetricks
winetricks directplay
cd ~/Documents
wget https://www.dropbox.com/s/6k82coiruvysezp/aoe2_tc_1_4.zip
unzip aoe2_tc_1_4.zip
echo "INSTALLED!"
echo "Command to play:"
@aok1425
aok1425 / install_aoe2.sh
Last active April 15, 2019 18:47
aoe2 tc w userpatch 1.4 installation instructions on mac
brew install wine winetricks wget
winetricks directplay
cd ~/Documents
wget https://www.dropbox.com/s/6k82coiruvysezp/aoe2_tc_1_4.zip
unzip aoe2_tc_1_4.zip
echo "INSTALLED!"
echo "Run winecfg, go to graphics tab, check 'Emulate a virtual desktop' and set initial resolution"
echo "Command to play:"
echo " $ wine ~/Documents/aoe2_tc/Age2_x1/age2_x1.exe NormalMouse"
# push subfolder in git repo called "app" to heroku
git push heroku `git subtree split --prefix app master`:master --force
###
pd.set_option('max_colwidth', 400)
from IPython.display import display
with pd.option_context("display.max_columns", 50):
display(df.head(2))
# adapted from https://github.com/alaw1290/CS591B1/blob/master/RTscrapers/moviescraper.py
from bs4 import BeautifulSoup
from selenium import webdriver
import locale
locale.setlocale( locale.LC_ALL, 'en_US.UTF-8' )
import datetime
driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver")
# driver = webdriver.PhantomJS() # oesn't work, for whatever reason
from IPython.core.debugger import Tracer; Tracer()()
$ tmux new -s session-name
$ tmux a -t session-name # to attach to particular session
$ tmux detach
or
$ Ctrl-b d
@aok1425
aok1425 / check_validation
Created December 25, 2014 23:48
Excel from Rima to Access for BPHC
# filenames MUST start w COD or DOR, for MCMOnlyUnit()
import pandas as pd
import pypyodbc
import os
from datetime import datetime
from math import isnan
from shutil import copy as copy_file
from numpy import float64
SELECT ML.PERSON.MEDRECNO AS MRN, ML.OBS.HDID, ML.OBS.OBSVALUE, ML.OBS.OBSDATE
FROM ML.PERSON INNER JOIN ML.OBS ON ML.PERSON.PID = ML.OBS.PID
WHERE ML.OBS.OBSDATE <= ADD_MONTHS(LAST_DAY(SYSDATE), -1) AND ML.OBS.OBSDATE > ADD_MONTHS(LAST_DAY(SYSDATE), -14) AND ML.OBS.XID = 100000000000000000000000000000000000 AND ML.OBS.CHANGE <10 AND
(ML.OBS.HDID = 2451
OR ML.OBS.HDID = 2753
OR ML.OBS.HDID =18283
OR ML.OBS.HDID = 92
OR ML.OBS.HDID = 6857
OR ML.OBS.HDID = 2323
OR ML.OBS.HDID = 2719