Instantly share code, notes, and snippets.

• Sort options
Created Apr 28, 2015
Anki slides import example notes.
View notes.txt
 Slide 3: What percentage of Indians are vegetarians? Why are they vegetarian? Slide 4: What are the things that a lacto-vegetarian can eat? Slide 6: What does veg lunch in New Delhi look like?
Created Mar 18, 2015
Implementation of various approximation algorithms for set cover problem.
View set-cover.py
 # There are many greedy algorithms that could be used to pick a collection of sets that is close to as small as possible. Here are some that you will consider in this problem. def isCovered(cover, allElems): coverElems = set() for s in cover: coverElems.update(s) return len(coverElems) == len(allElems) def getAllElems(sets): elems = set()
Last active Aug 29, 2015
Simulation designed for solving "Mining Massive Datasets MOOC@Coursera" exercise
 typealias Slot Int typealias Bidder Int immutable BidderRoundData numSlots :: Int ctr :: Dict{(Bidder, Slot), Float64} bids :: Vector{Float64} budgets :: Vector{Float64} clickThroughs :: Int end
Created Mar 4, 2015
Process raw Wikipedia data and create Anki deck for collective nouns
View collective-deck-import.py
 import sys import csv ################################################################### # Handling inputs ################################################################### def getInput(csvFileName): with file(csvFileName) as f: reader = csv.DictReader(f, fieldnames=['Subject', 'CollectiveNoun', 'Notes', 'Source'])
Created Feb 12, 2015
View keybase.md

### Keybase proof

I hereby claim:

• I am musically-ut on github.
• I am musicallyut (https://keybase.io/musicallyut) on keybase.
• I have a public key whose fingerprint is 8709 ADBA 5F02 32DF 0378 6521 88FC 244A C09F F3C1

To claim this, I am signing this object:

Created Feb 22, 2014
View rickshaw-node.js
 function classListShim(view) { "use strict"; if (!('HTMLElement' in view) && !('Element' in view)) return; var classListProp = "classList" , protoProp = "prototype" , elemCtrProto = (view.HTMLElement || view.Element)[protoProp]
Last active Dec 31, 2015 — forked from korenmiklos/button.css
View button.css
 button { font: 14px Helvetica Neue; background-color: #222; background-image: -moz-linear-gradient(top, rgba(255,255,255,.25), rgba(255,255,255,.11)); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, rgba(255,255,255,.25)),color-stop(1, rgba(255,255,255,.11))); background-image: -webkit-linear-gradient(rgba(255,255,255,.25), rgba(255,255,255,.11)); color: #fff; text-rendering: optimizeLegibility; text-shadow: 0 -1px 1px #222; padding: 6px 10px 6px 10px;
Created Dec 10, 2013 — forked from parnelandr/Food.csv
View Food.csv
Food by Deliciousness Source: Andrew Parnell Metadata Notes: Things I think are yummy Food Rating Bananas 7 Green Beans 5 Egg Salad Sandwich 3 Ice Cream 5 Vegemite 8
Last active Dec 29, 2015 — forked from mbostock/.block
D3's time axis with 6 hour marks.

The tick format provided by d3.time.scale is a multi-scale tick format, meaning that it formats times differently depending on the time. For example, the start of February is formatted as "February", while February second is formatted as "Feb 2". The format is implemented using an array of time formats, each with an associated filter. The first filter that returns true is used. (In the implementation below, the formats are processed in reverse order.) You can create your own custom multi-scale time format using the same technique with only a few lines of code.

This format prints only hours of days, rounding them to the nearest 6 hours mark.

Last active Dec 29, 2015 — forked from mbostock/.block
6 hour marks with d3's time axis.