Skip to content

Instantly share code, notes, and snippets.

View LucaCappelletti94's full-sized avatar

Luca Cappelletti LucaCappelletti94

View GitHub Profile
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@FedericoV
FedericoV / gist:0e7d6d8c8794a99a7a42
Created May 28, 2015 08:06
Cosine Similarity that handles NaN with Numba
import numba
@numba.jit(target='cpu', nopython=True)
def fast_cosine(u, v):
m = u.shape[0]
udotv = 0
u_norm = 0
v_norm = 0
for i in range(m):
if (np.isnan(u[i])) or (np.isnan(v[i])):

Build tensorflow on OSX with NVIDIA CUDA support (GPU acceleration)

These instructions are based on Mistobaan's gist but expanded and updated to work with the latest tensorflow OSX CUDA PR.

Requirements

OS X 10.10 (Yosemite) or newer

@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@andreycizov
andreycizov / mp_coverage.py
Last active May 27, 2019 08:40
Enabling Python 3.5 Coverage support for multiprocessing Pool
import logging
import os
from multiprocessing.pool import Pool as OrigPool
from coverage import Coverage
from multiprocessing.context import Process, DefaultContext, _concrete_contexts
logger = logging.getLogger(__name__)
@zommiommy
zommiommy / GetFileInFolder.md
Last active January 6, 2019 10:35
GetFileInFolder

A little recursive function that return the list of absolute path of all the file in a folder.

from os import listdir
from os.path import isfile

def get_file_in_folder(path="."):
    if isfile(path):
 return path
@zommiommy
zommiommy / Firing_up_LaTex_on_Windows.md
Last active April 5, 2021 16:42
Firing up LaTex on Windows 🔥

Firing up LaTex on Windows 🔥

Tex

There are 2 main Tex Distribution for windows The main difference is that TexLive has tlmgr that allows you to make a granular installation downloading only the package that you'll need. While MikTex has tons of packagee per installed but it works too.

TexLive

TexLive for windows Click here to download it (Warning: The full installation of TexLive is big and it will take a while)

@lioutasb
lioutasb / mrr_metric.py
Created July 26, 2018 23:09
Tensorflow implementation of Mean Reciprocal Rank (mrr) metric compatible with tf.Estimator
import tensorflow as tf
def mrr_metric(labels, predictions, weights=None,
metrics_collections=None,
updates_collections=None,
name=None):
with tf.name_scope(name, 'mrr_metric', [predictions, labels, weights]) as scope:
@callahantiff
callahantiff / keyword_search_github_repositories.py
Last active September 9, 2024 11:43
GitHub API Repository Search (Python 3.6.2)
#!/usr/bin/env python3.6.2
# -*- coding: utf-8 -*-
# run script from command line via python3 keyword_search_github_repositories.py
import click
import datetime
import time
from github import Github