Skip to content

Instantly share code, notes, and snippets.

View RodrigoCMoraes's full-sized avatar

RodrigoCMoraes RodrigoCMoraes

  • São Paulo, SP, Brazil
View GitHub Profile
# Set vi key bindings mode
set -g mode-keys vi
set -g status-keys vi
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# List of plugins
@wdsrocha
wdsrocha / google_shell_style_guide.md
Created July 11, 2019 13:28
Google Shell Style Guide - In Markdown!

Google Shell Style Guide

Original revision: 1.26

Paul Armstrong
Too many more to mention

Parsed to Markdown by Wesley Rocha. See source.

@chriscandy
chriscandy / install-arch-linux-using-efi-and-grub.md
Last active June 30, 2024 04:28
Install Arch Linux using EFI and GRUB

Installing Arch linux with EFI

  1. Change keyboard layout:

    • loadkeys no
  2. Verify boot mode:

    • ls /sys/firmware/efi/efivars (If the directory exist your computer supports EFI)
  3. Ping some site on the Internet to verify connection:

  • ping archlinux.org
@dweldon
dweldon / install-docker.sh
Last active April 8, 2022 11:18
Install docker CE on Linux Mint 18.3
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
@ashokpant
ashokpant / cuda_9.0_cudnn_7.0.sh
Last active November 16, 2023 21:42
Install CUDA Toolkit v9.0 and cuDNN v7.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v9.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb)
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda-9-0
@nikhilkumarsingh
nikhilkumarsingh / file_downloader.py
Last active June 24, 2024 12:15
A file downloader with progress bar for terminal
from tqdm import tqdm
import requests
chunk_size = 1024
url = "http://www.nervenet.org/pdf/python3handson.pdf"
r = requests.get(url, stream = True)
total_size = int(r.headers['content-length'])
@vbalnt
vbalnt / siamese.py
Last active March 1, 2019 01:50
train on siamese graph - custom mini batches
'''Train a Siamese MLP on pairs of digits from the MNIST dataset.
It follows Hadsell-et-al.'06 [1] by computing the Euclidean distance on the
output of the shared network and by optimizing the contrastive loss (see paper
for mode details).
[1] "Dimensionality Reduction by Learning an Invariant Mapping"
http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf
Run on GPU: THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python mnist_siamese_graph.py
@mminer
mminer / cachedecorator.py
Created January 12, 2015 23:57
An example of a Python decorator to simplify caching a function's result.
"""An example of a cache decorator."""
import json
from functools import wraps
from redis import StrictRedis
redis = StrictRedis()
def cached(func):
@ondrejh
ondrejh / mountnfs.sh
Created January 29, 2014 10:43
Bash script: Wakeup and mount NFS server.
#!/bin/bash
#
# This script should do:
#
# 1) test if nfs folder is mounted and exit 0 if yes
# 2) try to mount it and exit 0 if success
# 3) try to wake the server if not possible to mount
# 4) wait while its not woked (pinging)
# 5) try againt 2-4 several times
@mislav
mislav / _readme.md
Last active June 28, 2024 15:16
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work: