Skip to content

Instantly share code, notes, and snippets.

View captain-pool's full-sized avatar
🎧
Focusing

Adrish Dey captain-pool

🎧
Focusing
View GitHub Profile
" plugins
let need_to_install_plugins = 0
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
let need_to_install_plugins = 1
endif
call plug#begin()
Plug 'tpope/vim-sensible'
"""
Open a random CVPR talk (oral or spotlight) in the browser
"""
import urllib.request, urllib.error
import webbrowser
import random
URL = "http://cvpr2020.thecvf.com/sites/default/files/2020-03/accepted_list_0.txt"
@yaroslavvb
yaroslavvb / install_pdb_handler.py
Created October 11, 2019 17:53
install_pdb_handler
def install_pdb_handler():
"""Signals to automatically start pdb:
1. CTRL+\\ breaks into pdb.
2. pdb gets launched on exception.
"""
import signal
import pdb
def handler(_signum, _frame):
@apsknight
apsknight / proposal.md
Last active March 28, 2025 18:17
GSoC Project Proposal

Project Proposal
Google Summer of Code 2018

Large-scale computing backend for Jupyter notebooks - HTCondor batch job submission and monitoring using the Ganga toolkit

CERN-HSF
High Energy Physics Software Foundation

Mentors:

  • Ulrik Egede
  • Jakub Moscicki
@davidwalter0
davidwalter0 / stash-pop-recover
Created August 10, 2017 17:42
Undoing accidental git stash pop
# https://stackoverflow.com/questions/6543519/undoing-accidental-git-stash-pop
# https://stackoverflow.com/questions/89332/how-to-recover-a-dropped-stash-in-git
accepted
If you have only just popped it and the terminal is still open, you will still have the hash value printed by git stash pop on screen (thanks, Dolda).
Otherwise, you can find it using this for Linux and Unix:
git fsck --no-reflog | awk '/dangling commit/ {print $3}'
and for Windows:
@poolio
poolio / depth_to_space_viz.py
Last active May 6, 2020 07:01
Subpixel convolution is tf.depth_to_space
def _phase_shift(I, r):
bsize, a, b, c = I.get_shape().as_list()
X = tf.reshape(I, (bsize, a, b, r, r))
X = tf.transpose(X, (0, 1, 2, 4, 3)) # bsize, a, b, 1, 1
X = tf.split(1, a, X) # a, [bsize, b, r, r]
X = tf.concat(2, [tf.squeeze(x, [1]) for x in X]) # bsize, b, a*r, r
X = tf.split(1, b, X) # b, [bsize, a*r, r]
X = tf.concat(2, [tf.squeeze(x, [1]) for x in X]) # bsize, a*r, b*r
return tf.reshape(X, (bsize, a*r, b*r, 1))
@noelboss
noelboss / git-deployment.md
Last active April 1, 2025 16:56
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active April 19, 2025 13:21
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@smdabdoub
smdabdoub / merge_git_repo_as_subdir
Created June 9, 2015 14:02
Merge one git repository into another repository as a sub-directory
# based on the following:
# http://saintgimp.org/2013/01/22/merging-two-git-repositories-into-one-repository-without-losing-file-history/
# http://blog.caplin.com/2013/09/18/merging-two-git-repositories/
git clone repo_main
git clone repo_sub
cd repo_main
git remote add repo_sub ../repo_sub
git fetch repo_sub
@ericdouglas
ericdouglas / super-tip.txt
Last active October 6, 2024 18:28
Change 4 spaces to 2 spaces indentation and change tab to spaces - Vim tip
// 4 spaces to 2 spaces
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
// Tab to 2 spaces
:%s/\t/ /g