Skip to content

Instantly share code, notes, and snippets.

View raprasad's full-sized avatar

Raman Prasad raprasad

View GitHub Profile
@raprasad
raprasad / index.html
Created August 27, 2020 22:23
Vue/Bootstrap Template
View index.html
<div id="app">
<nav class="navbar navbar-light fixed-top">
<div class="navbar-text ml-auto d-flex">
<button class="btn btn-sm btn-outline-success"
@click="sliderStatus = !sliderStatus">
<i class="fas fa-dollar-sign"></i></button>
<div class="dropdown ml-2" v-if="cart.length>0">
<button class="btn btn-success btn-sm dropdown-toggle"
id="cartDropdown" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
@raprasad
raprasad / index.html
Last active August 27, 2020 22:24
Vue/Bootstrap Template
View index.html
<div id="app">
<nav class="navbar navbar-light fixed-top">
<div class="navbar-text ml-auto d-flex">
<button class="btn btn-sm btn-outline-success"
@click="sliderStatus = !sliderStatus">
<i class="fas fa-dollar-sign"></i></button>
<div class="dropdown ml-2" v-if="cart.length>0">
<button class="btn btn-success btn-sm dropdown-toggle"
id="cartDropdown" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
@raprasad
raprasad / nyu-augment.md
Last active June 24, 2019 20:28
nyu augment
View nyu-augment.md

Augment via REST and python requests

def run_augment_test():
    """Augment via REST"""

    # Query result
    #
@raprasad
raprasad / isi-DA_college_debt.md
Created April 29, 2019 16:06
ISI error with DA_college_debt
View isi-DA_college_debt.md
  • Dataset: DA_college_debt

(1) Initial request

{
    "userAgent": "TwoRavens",
    "version": "2019.2.27",
@raprasad
raprasad / config-path.md
Created January 7, 2019 19:58
config temp path
View config-path.md

Code to get the D3M temp directory accessible by TA2/TA2

from os.path import join
from tworaven_apps.configurations.utils import \
    (get_latest_d3m_config,)

d3m_config = get_latest_d3m_config()
if not d3m_config:
@raprasad
raprasad / file_check.py
Last active November 28, 2018 18:23
Script to check that crime incidents exist
View file_check.py
"""python3 script to check data files
For use with New Haven Crime Files on Dataverse:
- https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/18J4ZW
"""
import json
from os.path import isfile
import sys
# --------------------------------------------
# SET YOUR DATA DIRECTORY HERE CONTAINING these files:
@raprasad
raprasad / ed_queries.md
Last active August 23, 2018 16:29
EventData saved queries
View ed_queries.md

Saved Queries for Event Data

Specifically, before seeing the app in action, I thought of these as two distinct parts:

  • (a) Saving/Retrieving queries to the database
  • (b) Running queries and storing the results in Dataverse
    • Run mongo query
    • Write result to a temporary file
    • Push the file and a related readme file to Dataverse
    • Publish the Dataset, allowing the new file to be publicly viewable
@raprasad
raprasad / ta3_data.md
Last active August 8, 2018 22:44
shareable csv data endpoint
View ta3_data.md
@raprasad
raprasad / add-file.md
Created July 24, 2018 18:25
add file
View add-file.md
from datetime import datetime
import json
import requests  # http://docs.python-requests.org/en/master/

# --------------------------------------------------
# Update the 4 params below to run this code
# --------------------------------------------------
dataverse_server = 'https://your dataverse server' # no trailing slash
api_key = 'api key'
@raprasad
raprasad / k8s_notes.md
Last active July 4, 2018 07:04
k8s notes
View k8s_notes.md

(1) We have a pod with multiple containers. Rough example:

- Pod

-- container 1:  webapp
      exposes port: 80

-- container 2: r-service
 exposes port: 8070