Skip to content

Instantly share code, notes, and snippets.

View vingkan's full-sized avatar

Vinesh Kannan vingkan

  • Nuna
  • San Francisco, California
View GitHub Profile
@vingkan
vingkan / starter.html
Created June 8, 2022 07:58
Example starter code to try out frontend development on CoderPad (React, Vue, or HTML/CSS/JS).
<html>
<head>
<meta charset="UTF-8">
<title>App</title>
<script src="https://unpkg.com/react@17.0.2/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="https://unpkg.com/@babel/standalone@7.13.12/babel.min.js"></script>
<style>
@vingkan
vingkan / example_discord_cat_bot.py
Last active January 9, 2022 01:19
Example Discord bot to send you cat pictures.
import discord
import os
import requests
from discord.ext import commands
DISCORD_BOT_TOKEN = os.environ["DISCORD_BOT_TOKEN"]
RANDOM_CAT_URL = "https://cataas.com"
@vingkan
vingkan / README.md
Last active June 12, 2019 04:41
Spectral Clustering Demo

Spectral Clustering Demo

Run the Jupyter notebook in your browser with Binder:

Binder

@vingkan
vingkan / assessor_solutions.sql
Created May 1, 2019 01:29
Solution queries for two truths and a lie with the Cook County Assessor's modeling data.
-- The only properties with 10 or more full bathrooms are apartments.
SELECT class
WHERE fbath >= 10
-- On average, properties designed from an architect's plan sold for twice as much as properties designed from a stock plan.
SELECT tp_plan, AVG(sale_price)
WHERE tp_plan IN (1, 2)
GROUP BY tp_plan
@vingkan
vingkan / rideshare_solutions.sql
Last active February 24, 2021 03:03
Solution queries for two truths and a lie with the rideshare dataset.
-- Most rides start and end in the Near North Side community area.
SELECT
pickup_community_area,
COUNT(*) as trips
GROUP BY pickup_community_area
ORDER BY trips DESC
-- On average, riders picked up in the Lincoln Square community area tip better than riders picked up in the Loop.
@vingkan
vingkan / fields.md
Created April 7, 2019 19:54
Night at Lyft - Trip Field Names

Trip Fields

Each trip has the following fields. See the descriptions below.

  • trip_id
  • taxi_id
  • trip_start_timestamp
  • trip_end_timestamp
  • trip_seconds
  • trip_miles
  • pickup_community_area
  • dropoff_community_area
@vingkan
vingkan / hawklinkscraper.js
Created March 27, 2019 21:22
Roster scraper for HawkLink (2019).
/*
* 1. Go to https://iit.campuslabs.com/engage/organization/acm/roster
* 2. Open the browser console
* 3. Copy and paste this script into the console and run
* 4. Keep tab open and do not click anywhere until the script completes
* 5. Save the page output as a .csv
*/
var showing = document.querySelector('#roster-members').parentElement.children[1].children[0].innerText.split(' ');
var total = parseInt(showing[3]);
@vingkan
vingkan / hawklinkscraper.js
Created March 27, 2019 21:22
Roster scraper for HawkLink (2019).
/*
* 1. Go to https://iit.campuslabs.com/engage/organization/acm/roster
* 2. Open the browser console
* 3. Copy and paste this script into the console and run
* 4. Keep tab open and do not click anywhere until the script completes
* 5. Save the page output as a .csv
*/
var showing = document.querySelector('#roster-members').parentElement.children[1].children[0].innerText.split(' ');
var total = parseInt(showing[3]);
@vingkan
vingkan / solution.sql
Created March 6, 2019 03:50
Solution to 20 questions with the traffic crash dataset.
SELECT RD_NO
WHERE weather_condition = "RAIN"
AND crash_type = "INJURY AND / OR TOW DUE TO CRASH"
AND (INJURIES_FATAL = 0 or injuries_fatal is null)
AND crash_hour IN (13,14,15)
AND DAMAGE = "OVER $1,500"
and first_CRASH_type not in ('REAR END','TURNING'
,'ANGLE', 'PARKED MOTOR VEHICLE', 'HEAD ON'
, 'FIXED OBJECT', "SIDESWIPE SAME DIRECTION")
AND STREET_DIRECTION in ("E","W")
@vingkan
vingkan / Facility Types Issue.ipynb
Created March 5, 2019 20:38
Facility Types Issue
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.