Skip to content

Instantly share code, notes, and snippets.

View musically-ut's full-sized avatar
🐙
🐢 🎣 🐠

Utkarsh Upadhyay musically-ut

🐙
🐢 🎣 🐠
View GitHub Profile
@luizrabachini
luizrabachini / screen-share
Last active August 29, 2015 14:02 — forked from Saicheg/screenshare
A shell script to share desktop screenshots using Dropbox
#!/bin/bash
# ------------------------------------------------------------
# Automatic screenshot sharing integrated with Dropbox
# ------------------------------------------------------------
# Requirements:
# dropbox
# gnome-screenshot
# xclip
# ------------------------------------------------------------
@musically-ut
musically-ut / collective-deck-import.py
Created March 4, 2015 10:34
Process raw Wikipedia data and create Anki deck for collective nouns
import sys
import csv
###################################################################
# Handling inputs
###################################################################
def getInput(csvFileName):
with file(csvFileName) as f:
reader = csv.DictReader(f, fieldnames=['Subject', 'CollectiveNoun', 'Notes', 'Source'])
@musically-ut
musically-ut / adverts.jl
Last active August 29, 2015 14:17
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
@musically-ut
musically-ut / set-cover.py
Created March 18, 2015 12:15
Implementation of various approximation algorithms for set cover problem.
# 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()
@musically-ut
musically-ut / notes.txt
Created April 28, 2015 22:09
Anki slides import example notes.
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?
@nebw
nebw / arXiv popularity scoring.ipynb
Created September 6, 2015 12:07
Popularity scoring for arXiv publications
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shama
shama / a_simple.js
Created September 17, 2012 16:38
Grunt Events
/*
* A) Simple Watch Events
*/
module.exports = function(grunt) {
grunt.initConfig({
nodeunit: {
files: ['test/**/*.js'],
},
watch: {
test: {
@musically-ut
musically-ut / README.md
Last active November 2, 2015 10:50
Scripts to convert sqlite

Scripts to convert datasets from unruly forms to SQLite

The script json2sqlite.py reads files which have one JSON block per new line to be inserted in a database. This has become a rather common dataformat which is easy to incrementally parse. The arguments to the scripts are self explanatory.

Example execution: python json2sqlite.py --gzip aggressive_dedup.json.gz amazon.sqlite reviews

For a more upto date scripts, see: Networks-Leraning/datasets2sqlite.

@musically-ut
musically-ut / README.md
Last active December 15, 2015 14:59
The circle-text plugin.

A demo for the circle-text plugin, which can place text aligned along the bottom of circles.

@eendeego
eendeego / Gruntfile.js
Created July 5, 2013 16:57
How to delay responses on connect middleware, eg, to test timeouts, on a yeoman's generated gruntfile.
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// ...