Skip to content

Instantly share code, notes, and snippets.

# Copyright 2019 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@rasmi
rasmi / setup.md
Last active November 1, 2023 15:46
Python development environment setup on Chromebook

Python development environment setup on Chromebook

Check for updates

Do this first!

sudo apt-get update && sudo apt-get dist-upgrade

Set root password

@rasmi
rasmi / document_ocr.py
Created November 30, 2018 18:00
Google Cloud Vision API Document OCR
#!/usr/bin/env python
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@rasmi
rasmi / eva.css
Last active February 20, 2021 01:16
Custom styles for https://evaduns.ky
/*
* WHOLE SITE
*/
/* Slightly purple links. */
.page-content a {
color: #283593 !important;
}
/* Increase space above header on mobile. */
@media (max-width: 767px) {
@rasmi
rasmi / time_series.sql
Created October 4, 2019 19:50
BigQuery time series aggregation example by Andrew Leach.
# Copyright 2019 Google LLC.
# SPDX-License-Identifier: Apache-2.0
WITH
# Generate a sample time series from the taxi trips dataset.
sample_time_series AS (
SELECT
SUBSTR(taxi_id, 16, 24) AS taxi_id, # Truncate for readability.
trip_start_timestamp,
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@rasmi
rasmi / upload_to_bq.sh
Created November 6, 2018 19:52
Upload Vera Incarceration Trends Dataset to BigQuery
#!/bin/sh
# Copyright 2018 Google LLC.
# SPDX-License-Identifier: Apache-2.0
DATA_FILENAME="incarceration_trends.csv"
DATA_URL="https://github.com/vera-institute/incarceration_trends/raw/master/incarceration_trends.csv"
BQ_DATASET_NAME="vera_data"
BQ_DATASET_DESCRIPTION="County-level jail data (1970-2015) and prison data (1983-2015)"
BQ_SCHEMA_FILENAME="schema.json"
BQ_SCHEMA_URL="https://gist.githubusercontent.com/rasmi/b46101a1d20d3da46bafbd77299126c9/raw/c7f12bbdff7adc61e763ff1be22bc21215dc3ff5/schema.json"
@rasmi
rasmi / schema.json
Created November 6, 2018 17:57
Incarceration Trends BigQuery Schema
[
{
"name": "yfips",
"type": "INT64",
"mode": "REQUIRED",
"description": "Unique ID: Year and FIPS code"
},
{
"name": "year",
"type": "INT64",
@rasmi
rasmi / yeti-setup.md
Last active December 24, 2016 23:28
Installing Python and TensorFlow on Yeti

Python Setup

Create an alias for the directory where we'll do our installation and computing.

$WORK = /vega/<group>/users/<username>

Now, install and setup the latest version of Python (2 or 3).

cd $WORK
mkdir applications
cd applications
@rasmi
rasmi / styles.css
Created December 10, 2016 18:31
Google Docs Minimal
/* Hide page break line */
.kix-page-compact::before {
border-style: none;
}
/* Hide Explore icon */
.docs-explore-widget {
display: none;
}