This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import mysql.connector | |
import numpy as np | |
import pandas as pd | |
from pandas import Series, DataFrame | |
# p as path, c as connection | |
with open('/Users/path/to/database/keys/prod_db.json') as p: | |
c = json.load(p) | |
p.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
console.log("outside test function"); | |
+function ($) { | |
console.log("inside test function"); | |
if (typeof $ == 'undefined') { | |
console.log("no jquery!"); | |
} else { | |
console.log("test function made it past check!"); | |
} | |
}(window.jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
from sqlalchemy import create_engine | |
# what is the database equivalent of 'hello world' anyways? | |
test_query = """ | |
SELECT COUNT(*) | |
FROM core.users a | |
WHERE a.date BETWEEN '2015-01-01' AND '2015-05-31' | |
GROUP BY 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from apiclient import errors | |
from apiclient.discovery import build | |
from oauth2client.client import OAuth2WebServerFlow | |
import httplib2 | |
import json | |
# easy access to account/view/property when using multiple accounts (e.g., ios app, android app, website) | |
with open('/Users/adrianp/py/json/ga_cred.json') as p: | |
gc = json.load(p) | |
p.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Pop this puppy into your Chrome console on a page where you need to observe changes to the dataLayer | |
* http://updates.html5rocks.com/2012/11/Respond-to-change-with-Object-observe | |
* | |
*/ | |
function chaChaChaChaChanges(changes) { | |
n = dataLayer.length-1; | |
console.dir(dataLayer[n]); |
NewerOlder