Skip to content

Instantly share code, notes, and snippets.

View nathanhinchey's full-sized avatar

Nathan Hinchey nathanhinchey

  • Brooklyn, NY, USA
View GitHub Profile
# Given a list of tuples which represent (movie_start_time, movie_end_time),
# write a function which will return whether or not there are any overlaps between the movies
movies = [
(1, 3),
(2, 5),
(8, 9),
(5, 8),
(4, 7),
]
@nathanhinchey
nathanhinchey / carta-test1.py
Created December 18, 2018 22:02
first test for carta
"""
Reproduce a dictionary structure represented by certificates_grouped_by_date_and_share_class_id
"""
from datetime import date
class Certificate:
def __init__(self, unique_label, date, share_class_id):
self.unique_label = unique_label
self.date = date
self.share_class_id = share_class_id
@nathanhinchey
nathanhinchey / absentee_counter.py
Last active October 25, 2017 16:01
Script to find students who have been absent full days
import csv
import sys
from operator import itemgetter
# To use, export the excel file to CSV,
# then in the shell run `python absentee.counter.py <name of csv goes here>`
"""
Original Stackoverflow question:
https://stackoverflow.com/questions/46858010/excel-script-to-find-names-that-meet-multiple-criteria
@nathanhinchey
nathanhinchey / imdb_data.md
Last active August 8, 2016 04:20
Data Exploration App for IMDb Metadata

#Data Exploration App for IMDb Metadata ##Overview The basic concept of the app is to take imdb metadata and allow visual data exploration with it. The data available includes movie titles, the year they were made, the IMDb rating, and the number of user votes (for ratings).

##Front End Appearance Users will be presented with two main ways to use the app

Ratings by year

Users can select what genres they are interested in -- either conjunction or disjunction -- and what range of years they want to see. A scatterplot will then be generated (using D3.js) to show how the quality of movies in their genre selections have changed over time.

A vs B Comparison

Users can select from a variety of categorizations -- years or year ranges, genres, ratings, or number of user votes. Those categories will be used to set up to comparisons between two.

@nathanhinchey
nathanhinchey / 0main.md
Last active December 8, 2015 19:19 — forked from canton7/0main.md
Git Bisect and Feature Branches

Git Bisect and Feature Branches

There are people out there who claim that merge-based workflows (that is, workflows which contain non-fast-forward merges) are bad. They claim that git bisect gets confused by merge-based workflows, and instead advocate rebase-based workflows without explicit feature branches.

They're wrong.

Furthermore, the "advantages" of their workflows are in fact disadvantages. Let me show you.

@nathanhinchey
nathanhinchey / TextAdventure.py
Created October 21, 2014 17:42
An adventure game framework in Python. Allows moving between rooms, interacting with objects, and saving and loading game states.
import textwrap
import os
##############################
#classes
class GameObject(object):
"""Set the uniqueName to a unique string"""
def __init__(self, uniqueName):
super(GameObject, self).__init__()