Skip to content

Instantly share code, notes, and snippets.

View isc-rsingh's full-sized avatar

Raj Singh isc-rsingh

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@isc-rsingh
isc-rsingh / one-data-set-microdata.html
Last active March 28, 2018 19:26
A dataset in described with structured metadata in schema.org microdata
<div itemscope itemtype="http://schema.org/Dataset" itemid="homes-1m-redfin-2016">
<meta itemprop="url" content="http://s3-api.us-geo.objectstorage.softlayer.net/opendata/misc/milliondollarhomes.csv" />
<h2>US Income</h2>
<i>(homes-1m-redfin-2016)</i>
<div class="description">Homes that sold for over a million USD in northeastern Massachusetts in a 3-month period in late 2016.</div>
<div itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
Publisher:
<span itemprop="name">Raj Singh</span>
</div>
<div class="keywords">Keywords: housing,income</div>
@isc-rsingh
isc-rsingh / one-data-set-json-ld.html
Last active March 28, 2018 19:27
A dataset in described with structured metadata in JSON-LD
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Dataset",
"identifier": "homes-1m-redfin-2016",
"name": "US Income",
"description": "Homes that sold for over a million USD in northeastern Massachusetts in a 3-month period in late 2016.",
"version": "2017-10-03",
"keywords": ["housing","income"],
"distribution": [
@isc-rsingh
isc-rsingh / google-structured-metadata.js
Last active March 28, 2018 19:27
Reads a JSON file in the format conforming to US govt CIO open data metadata guidelines and writes an HTML file conforming to Google and schema.org
/**
* Reads a JSON file in the format conforming to the open data metadata guidelines
* promulgated by the US Federal CIO office (https://project-open-data.cio.gov/v1.1/schema/)
* and writes an HTML file conforming to Google and schema.org
* https://developers.google.com/search/docs/data-types/dataset
* http://schema.org/Dataset
*/
var fs = require('fs')
const metadata = require('./meta.json')
{
"type": "DataCatalog",
"title": "My Data Catalog",
"modified": "2018-02-02",
"accessLevel": "public",
"conformsTo": "https://project-open-data.cio.gov/v1.1/schema",
"datasets": [
{
"@context": "http://schema.org/",
"@type": "dcat:Dataset",
@isc-rsingh
isc-rsingh / .s3cfg
Created March 19, 2018 17:56
s3cmd configuration for IBM cloud object storage
[default]
access_key = ACCESSKEYGOESHERE
gpg_command = /usr/local/bin/gpg
host_base = s3-api.us-geo.objectstorage.softlayer.net
host_bucket = %(bucket)s.s3-api.us-geo.objectstorage.softlayer.net
secret_key = SECRETKEYGOESHERE
use_https = True
urban_df['CAT'] = 'EXURBAN'
urban_df['CAT'][(urban_df['POPPERKMSQ'] >= 2900)] = 'URBAN'
urban_df['CAT'][(urban_df['POPPERKMSQ'] < 2900) & (urban_df['POPPERKMSQ'] >= 100) & (urban_df['MEDYRBUILT'] < 1980) & (urban_df['MEDYRBUILT'] >= 1946)] = 'SUBURBANEARLY'
urban_df['CAT'][(urban_df['POPPERKMSQ'] < 2900) & (urban_df['POPPERKMSQ'] >= 100) & (urban_df['MEDYRBUILT'] >= 1980)] = 'SUBURBANLATE'
@isc-rsingh
isc-rsingh / urbanity-map.ipynb
Created July 30, 2017 02:17
Urbanity in the US - Mapping with Mapbox
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.