Skip to content

Instantly share code, notes, and snippets.

@walkoncross
walkoncross / tm.completion.bash
Created November 17, 2016 22:17 — forked from ttscoff/tm.completion.bash
Fuzzy Bash completion for tmux session/window using [tm](http://brettterpstra.com/2014/05/11/making-my-tmux-life-easier/)
_tm_complete() {
local rx
local token=${COMP_WORDS[$COMP_CWORD]}
local IFS=$'\t'
local words
if [ $COMP_CWORD -eq 2 ]; then
words=$(tmux list-windows -t ${COMP_WORDS[1]} 2> /dev/null | awk '{print $2}' | tr -d '*-' | tr "\n" "\t")
elif [ $COMP_CWORD -eq 1 ]; then
words=$(tmux -q list-sessions 2> /dev/null | cut -f 1 -d ':' | tr "\n" " ")
fi
@walkoncross
walkoncross / tmux-cheatsheet.markdown
Created November 21, 2016 23:22 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@walkoncross
walkoncross / How to Set Tmux auto-completion
Last active November 21, 2016 23:28
How to Set Tmux auto-completion
1. Download tmux-autocompletion.sh from this gist
2. In your ~/.bashrc, Add a line:
source /path/to/tmux-autocompletion.sh
3. Source ~/.bashrc
Bravo!!!
# unpack the library
gzip -d cudnn-6.5-linux-x64-v2.tar.gz
tar xf cudnn-6.5-linux-x64-v2.tar
# copy the library files into CUDA's include and lib folders
sudo cp cudnn-6.5-linux-x64-v2/cudnn.h /usr/local/cuda-7.0/include
sudo cp cudnn-6.5-linux-x64-v2/libcudnn* /usr/local/cuda-7.0/lib64
@walkoncross
walkoncross / Experiment.py
Created November 29, 2016 22:38 — forked from k0emt/Experiment.py
Basic Hello world in Python with corresponding unittest
__author__ = 'k0emt'
class Greeter:
def __init__(self):
self.message = 'Hello world'
# print self.message
@walkoncross
walkoncross / bits.S
Created December 29, 2016 01:31 — forked from comzyh/bits-i7-7700HQ.s
Bit Count test
.file "A.cpp"
.section .rdata,"dr"
.align 8
.LC0:
.ascii "bits1: %5lu, bits2: %5lu, builtin: %5lu\12\0"
.text
.p2align 4,,15
.def _Z6printfPKcz.constprop.0; .scl 3; .type 32; .endef
.seh_proc _Z6printfPKcz.constprop.0
_Z6printfPKcz.constprop.0:
@walkoncross
walkoncross / How to write shared libraries.md
Last active January 11, 2017 00:44
How to write shared libraries
@walkoncross
walkoncross / gist:28e949c8b36f9b0a639fee461a4ecc8c
Created February 13, 2017 22:49 — forked from crizCraig/gist:2816295
Download images from Google Image search using Python
import json
import os
import time
import requests
from PIL import Image
from StringIO import StringIO
from requests.exceptions import ConnectionError
def go(query, path):
"""Download full size images from Google image search.
@walkoncross
walkoncross / numpy-image-bgr-to-rgb.md
Last active March 20, 2023 16:49
Numpy / OpenCV image BGR to RGB

(from https://www.scivision.co/numpy-image-bgr-to-rgb/)

Numpy / OpenCV image BGR to RGB

Conversion between any/all of BGR, RGB, and GBR may be necessary when working with Matplotlib expects M x N x 3 image, where last dimension is RGB.

OpenCV expects M x N x 3 image, where last dimension is BGR.

Scientific Cameras, some of which output an M X N x 3 image, where last dimension is GBR

name: "CenterFace_Resnet"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 112
input_dim: 96
layer {
name: "conv1a"
type: "Convolution"