Skip to content

Instantly share code, notes, and snippets.

Avatar

Raman Prasad raprasad

View GitHub Profile
@raprasad
raprasad / index.html
Created Aug 27, 2020
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 Aug 27, 2020
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">
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 Apr 29, 2019
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",
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 Nov 28, 2018
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 Aug 23, 2018
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 Aug 8, 2018
shareable csv data endpoint
View ta3_data.md
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'
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