Skip to content

Instantly share code, notes, and snippets.

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

Utkarsh Upadhyay musically-ut

🐙
🐢 🎣 🐠
View GitHub Profile
@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.
@revolunet
revolunet / python-es6-comparison.md
Last active April 22, 2024 19:22
# Python VS JavaScript ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@fregante
fregante / git-get-git-put.md
Created June 30, 2015 18:34
Use git get and put instead of git pull and push

As explained on Don't Be Scared of git rebase, git fetch+rebase is a better alternative to git pull; unfortunately it's not as concise.

git get

From now on, use git get instead of git pull, a custom command that does this:

# get data from remote
git fetch origin
# rebase the remote branch with the same name as local
@pravsripad
pravsripad / plot_circle_von_mises.py
Created June 22, 2015 12:53
Circular bar plot - von Mises distribution
#!/usr/bin/env python
# Inspired from :
# http://matplotlib.org/examples/pie_and_polar_charts/polar_bar_demo.html
''' Plot von Mises distribution as a circular bar plot. '''
import numpy as np
import matplotlib.pyplot as pl
@jonlong
jonlong / cloudflare-purge-post-receive
Last active May 16, 2022 05:30
Purge CloudFlare when deploying GitHub Pages: post-receive hook
#!/bin/sh
#
# Purge the CloudFlare cache after pushing an update to GitHub Pages
#
# To use, rename this file to "post-receive" and drop it into the `.git/hooks/` directory in your project's root.
# Change the $branch value based on the type of page you're deploying.
# Use "master" for Organization Pages, and "gh-pages" for Project Pages.
#
# Find your CloudFlare API token here: https://www.cloudflare.com/a/account/my-account
@chris1610
chris1610 / Ipython-pandas-tips-and-tricks.ipynb
Last active October 18, 2016 15:57
Ipython Notebook from pbpython.com
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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?
@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 / 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 / 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'])