Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active July 22, 2024 13:08
set -e, -u, -o, -x pipefail explanation
@MichaelCurrie
MichaelCurrie / Dropzone with Python 3
Last active December 14, 2023 10:19
Drag-and-drop upload files, via JavaScript, to a simple Python 3 HTTP server
#Drag-and-drop upload files, via JavaScript, to a simple Python 3 HTTP server
@dschep
dschep / raspbian-python3.6.rst
Last active October 24, 2023 14:57 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).
@pratos
pratos / condaenv.txt
Created November 30, 2016 07:01
To package a conda environment (Requirement.txt and virtual environment)
# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@jclosure
jclosure / gist:2732898f35adaf4a8bb79f7805bc7d87
Created May 2, 2016 04:06
install emacs 24.5 from src on Centos 6
yum install gcc make ncurses-devel
yum install giflib-devel libjpeg-devel libtiff-devel -y
cd /usr/local/src
wget http://ftp.gnu.org/pub/gnu/emacs/emacs-24.5.tar.gz
tar xzvf emacs-24.5.tar.gz
cd emacs-24.5
./configure --without-x --without-selinux
make && make install
which emacs
emacs --version
#!/usr/bin/env python
# -*- encoding:utf-8 -*-
from PyPDF2 import PdfFileReader
import re
import sys
pdf_file = sys.argv[1]
doi_re = re.compile("10.(\d)+/([^(\s\>\"\<)])+")
input = PdfFileReader(file(pdf_file, "rb"))
@jctosta
jctosta / screen_cheatsheet.markdown
Last active July 21, 2024 23:07
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@icholy
icholy / go_zsh_complete.md
Last active January 9, 2022 19:19
Zsh Tab Completion for Golang

Zsh Tab Completion for Golang

This is pretty specific to my setup but the idea can be adapted to work with pretty much anything.

Go has a flag package which makes parsing command line arguments really easy.

package main
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 22, 2024 17:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname