Skip to content

Instantly share code, notes, and snippets.

@JedIV
JedIV / us.json
Created September 26, 2018 20:25
its a bunch of json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import dataiku
from dataiku import pandasutils as pdu
import pandas as pd
import shutil
import zipfile
def extract_bundle(zip_filepath, save_location):
if not os.path.isdir(save_location):
# path to zipped bundle
@JedIV
JedIV / conditional_scenario_run.py
Last active January 29, 2019 00:20
Checks the metrics of a dataset and conditionally runs a scenario
from dataiku.scenario import Scenario
import dataiku
### Set up objects
# The Scenario object is the main handle from which you initiate steps
scenario = Scenario()
# The Project that we'll be working with
# set up an api client
@JedIV
JedIV / crs_lat_lon_convert.py
Last active September 14, 2018 14:03
CRS to Lat/Lon with only base packages
import math
def utmToLatLng(utmZone, mean_easting, mean_northing, northernHemisphere):
utmZone = int(utmZone)
mean_easting = float(mean_easting)
mean_northing = float(mean_northing)
northernHemisphere = int(northernHemisphere)
if not northernHemisphere:
mean_northing = 10000000 - mean_northing
@JedIV
JedIV / generate_prepare.sh
Created February 8, 2018 00:45
prepare recipe curl
curl --request POST \
--url http://localhost:8000/public/api/projects/CLEANPROJ/recipes/ \
--header 'content-type: application/json' \
--data '
{
"name": "compute_crm_last_year_prepared",
"projectKey": "CLEANPROJ",
"type": "shaker",
"neverRecomputeExistingPartitions": false,
"optionalDependencies": false,
@JedIV
JedIV / index.html
Last active August 29, 2015 14:01
Sleep Cycles Together
<!DOCTYPE html>
<html>
<head>
<title>Why Can't I Sleep</title>
<link rel="stylesheet" type="text/css" href="sleep_spag.css" />
<script type="text/javascript" src="http://media.flowingdata.com/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://media.flowingdata.com/js/d3.js?1.29.1"></script>
<script type="text/javascript" src="http://media.flowingdata.com/js/d3.time.js?1.29.1"></script>
<script type="text/javascript" src="http://media.flowingdata.com/js/d3.csv.js?1.29.1"></script>
@JedIV
JedIV / index.html
Last active August 29, 2015 14:01
Sleep Cycles Over Time
<!DOCTYPE html>
<html>
<head>
<title>Why Can't I Sleep</title>
<link rel="stylesheet" type="text/css" href="sleep_spag.css" />
<script type="text/javascript" src="http://media.flowingdata.com/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://media.flowingdata.com/js/d3.js?1.29.1"></script>
<script type="text/javascript" src="http://media.flowingdata.com/js/d3.time.js?1.29.1"></script>
<script type="text/javascript" src="http://media.flowingdata.com/js/d3.csv.js?1.29.1"></script>
@JedIV
JedIV / index.html
Last active August 29, 2015 14:01
Movies: Earnings Ratio V Budget
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
.axis line {
@JedIV
JedIV / citypop_with_lat_long.csv
Last active August 29, 2015 13:56
US Population Viewer
year rank city pop latitude longitude
0 1790 1 Philadelphia 44.1 39.952335 -75.16378900000001
1 1790 2 New York 33.1 40.7143528 -74.00597309999999
2 1790 3 Boston 18.3 42.3584308 -71.0597732
3 1790 4 Charleston 16.4 32.7765656 -79.93092159999999
4 1790 5 Salem, MA 13.6 42.51954 -70.8967155
5 1790 6 Baltimore 13.5 39.2903848 -76.6121893
6 1790 7 Newport, RI 6.7 41.4901024 -71.3128285
7 1790 8 Providence 6.4 41.8239891 -71.4128343
8 1790 9 Gloucester, MA 5.3 42.6159285 -70.6619888