Skip to content

Instantly share code, notes, and snippets.

View kkhanal18's full-sized avatar

kkhanal kkhanal18

  • Washington DC
View GitHub Profile
@kkhanal18
kkhanal18 / 0_reuse_code.js
Created November 6, 2016 14:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import React from 'react';
interface PopulationData {
city: string;
population: number;
}
const data: PopulationData[] = [
{
city: 'New York',
[
{
"city": "New York",
"country": "United States",
"population": 8399000,
"area": 468.9,
"currency": "US dollar",
"language": "English"
},
{
@kkhanal18
kkhanal18 / json2csv.js
Created March 13, 2024 03:11
json to csv
const fs = require('fs')
const Papa = require('papaparse');
async function main() {
const API = "https://www.fda.gov/about-fda/data-export/downloadable-files?_format=json&field_foia_record_type%5b%5d=3949&field_foia_record_type%5b%5d%20=3950"
const response = await fetch(API)
let data = await response.json();
csv = Papa.unparse(data)