Skip to content

Instantly share code, notes, and snippets.

Utkarsh Upadhyay musically-ut

Block or report user

Report or block musically-ut

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jnothman / bench_semi_supervised_n_iter
Created Jul 5, 2017
Benchmarking `sklearn.semi_supervised` `n_iter_` as a function of model and data characteristics
View bench_semi_supervised_n_iter
import numpy as np
from sklearn import datasets
from sklearn.semi_supervised import LabelPropagation, LabelSpreading
###for n_samples in [20, 200, 2000, 20000]:
### X, y = datasets.make_classification(n_samples=n_samples, n_classes=3, n_informative=3)
for (X, y) in [datasets.load_iris(return_X_y=True)]:
for model in [LabelPropagation(max_iter=1000),
musically-ut /
Created Mar 16, 2017
Setting up a new server by copying config files from local computer.
set -e
set -u
set -o pipefail
if [ -z $1 ]
echo "Usage: $0 [user@]servername"
exit 1
musically-ut /
Last active Apr 1, 2019
Poor man's parallel execution on servers
#!/usr/bin/env bash
set -e
for N in {1..5}
for M in {0.1,1,2,5,10};
# Replace ./ with your program to run it in parallel
./ -N $N -M $M > output/stdout_N${N}_M${M}.txt &
alekseykulikov /
Last active Jan 21, 2020
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

musically-ut /
Last active Aug 14, 2016
Pre-commit hook to avoid committing lines with '#NO-GIT"
git diff --cached --name-only | \
xargs egrep -i --color --with-filename -n "$PAT" && echo "Found '"$PAT"' in code about to be committed. Rejecting commit." && exit 1
# Exit with error code zero if all went well.
exit 0
'''This script goes along the blog post
"Building powerful image classification models using very little data"
It uses data that can be downloaded at:
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
jiahao / nrules.svg
Last active Nov 14, 2016
What do .gitignore files tell us about the inherent complexity of programming languages? This gist can be run on data from GitHub's own collection of gitignore templates, whose repository is at, and counts how many rules are present in the template for each programming language.
View nrules.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Isaddo / import-github-labels.js
Last active Feb 16, 2020
import github labels via console command
View import-github-labels.js
Go on your labels page (
Edit the following label array
Use this snippet to export github labels (
and replace it
Paste this script in your console
Press Enter!!

Broadcast Code Readme

This project is Python2-compatible and have issues while running with python 3. So please use Python2 (We used Anaconda's CPython distribution, maybe PyPy would be faster, but I don't even know whether it's OK to move to PyPy)

1. Data Access

All data access related classes are in data package. We suppose there are two SQLite databases, namely db.sqlite3 and links.sqlite3 which are stored on shared memory (/dev/shm) for faster access (they should be copied, in case of vanishing). First DB, holds tweets table with following schema:

CREATE TABLE tweets (user_id integer, tweet_time integer);
musically-ut / nngraph_plot_in_itorch.lua
Last active Apr 5, 2016
How to show an nnGraph plot in iTorch
View nngraph_plot_in_itorch.lua
require 'graph';
require 'os';
function displayGraph(g, forward)
local imgFile = os.tmpname() .. '.png'
local dag = g.fg
if forward == false then
dag =
You can’t perform that action at this time.