Skip to content

Instantly share code, notes, and snippets.

View NISH1001's full-sized avatar
💭
Staring into the abyss...

Nish NISH1001

💭
Staring into the abyss...
View GitHub Profile
@samundra
samundra / youtubeplayer.sh
Last active October 5, 2017 10:52
Borderless youtube player
#!/bin/bash
# Play and download the youtube video simultaneously
# Author: Samunddra
# Update Date: 2016-12-14 16:29:14 PM
#
# Use `screen` to play it in the background, fork screen process and exit, enjoy
#
# DEPENDENCIES
# - sudo apt install -y jq mplayer youtube-dl
#

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@teocci
teocci / AwesomeCourses.md
Last active March 15, 2025 11:39
List of awesome university courses for learning Computer Science!

Awesome Courses Awesome

Introduction

There is a lot of hidden treasure lying within university pages scattered across the internet. This list is an attempt to bring to light those awesome courses which make their high-quality material i.e. assignments, lectures, notes, readings & examinations available online for free.

Table of Contents

@Arinerron
Arinerron / permissions.txt
Last active May 6, 2025 18:23
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
import numpy as np
def sum_vecs(embed,text):
tokens = text.split(' ')
vec = np.zeros(embed.W.shape[1])
for idx, term in enumerate(tokens):
if term in embed.vocab:
vec = vec + embed.W[embed.vocab[term], :]
import numpy as np
from sklearn.svm import SVC
from sklearn.decomposition import PCA
from sklearn.cross_validation import train_test_split
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import classification_report
import matplotlib.pyplot as plt
import pickle
@amn41
amn41 / embedding.py
Last active October 17, 2017 01:19
class Embedding(object):
def __init__(self,vocab_file,vectors_file):
with open(vocab_file, 'r') as f:
words = [x.rstrip().split(' ')[0] for x in f.readlines()]
with open(vectors_file, 'r') as f:
vectors = {}
for line in f:
vals = line.rstrip().split(' ')
vectors[vals[0]] = [float(x) for x in vals[1:]]
@yurivish
yurivish / venn-diagrams.js
Last active December 26, 2020 03:20
Area-proportional Venn Diagrams
// Since `overlapArea` function is monotonic increasing, we can perform a
// simple bisection search to find the distance that leads to an overlap
// area within epsilon of the desired overlap.
function distanceForOverlapArea(r1, r2, desiredOverlap) {
// Ensure r1 <= r2
if (r1 > r2) {
var temp = r2;
r2 = r1;
r1 = temp;
}
@mlgill
mlgill / README.md
Last active November 23, 2022 18:02
Sets up a data science focused conda environment use a specified python version and path.

Automated Conda Setup

Michelle L. Gill
Updated: 2017/05/20

Regularly updated Gist located here.

This bash script will download and setup a Conda environment on Mac OS X or Linux using a specified Python version (2.7, 3.6) and packages. The Conda installation path and environment name can also be specified. All settings are input at the beginning of the script (see below).

If the Conda directory exists and can be determined to be a Conda installation, a new environment will be created. If the directory does exist but does not appear to be a Conda installation, the script will quit to avoid accidentally overwriting a file.

@jayapal
jayapal / get_color_code.py
Created May 27, 2016 07:37
get_color_code.py
from sklearn.cluster import KMeans
from sklearn import metrics
import cv2
# By Adrian Rosebrock
import numpy as np
import cv2
# Load the image
image = cv2.imread("red.png")