Skip to content

Instantly share code, notes, and snippets.

View Guillawme's full-sized avatar
💭
I may be slow to respond (days).

Guillaume Gaullier Guillawme

💭
I may be slow to respond (days).
View GitHub Profile
@nifl
nifl / grok_vi.mdown
Created August 29, 2011 17:23
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@bartlomiejdanek
bartlomiejdanek / git-remove-file.sh
Created January 10, 2012 10:23
remove file from git history
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
if [ $# -eq 0 ]; then
exit 0
@cosimo
cosimo / wget-exit-codes.txt
Last active September 15, 2023 10:09
wget exit codes
This is the list of exit codes for wget:
0 No problems occurred
1 Generic error code
2 Parse error — for instance, when parsing command-line options, the .wgetrc or .netrc…
3 File I/O error
4 Network failure
5 SSL verification failure
6 Username/password authentication failure
7 Protocol errors
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active May 2, 2024 23:15
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@glnds
glnds / less-cheatsheet.md
Last active May 21, 2024 07:23
Less Cheatsheet

Less Cheatsheet

less {filename}

Navigation
SPACE forward one window
b backward one window
d forward half window
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@hadley
hadley / ds-training.md
Created March 13, 2015 18:49
My advise on what you need to do to become a data scientist...

If you were to give recommendations to your "little brother/sister" on things that they need to do to become a data scientist, what would those things be?

I think the "Data Science Venn Diagram" (http://drewconway.com/zia/2013/3/26/the-data-science-venn-diagram) is a great place to start. You need three things to be a good data scientist:

  • Statistical knowledge
  • Programming/hacking skills
  • Domain expertise

Statistical knowledge

@andersjohansson
andersjohansson / emacs-zotero-bib-fetch.el
Created March 31, 2016 10:05
Emacs-zotero-bib-fetch: fork of zotelo to use better-bibtex's pull export
;;; emacs-zotero-bib-fetch.el --- Manage Zotero collections from emacs
;;
;; Filename: emacs-zotero-bib-fetch.el
;; Author: Anders Johansson, based on zotelo by Spinu Vitalie
;; Maintainer: Anders Johansson
;; Copyright (C) 2011-2014, Anders Johansson and Spinu Vitalie
;; Created: 1 Jul 2014
;; Version: 1.2
;; URL: https://github.com/andersjohansson/emacs-zotero-bib-fetch
;; Keywords: zotero, emacs, reftex, bibtex, bibliography manager
@bbarad
bbarad / tomoseg_to_imod.py
Created December 5, 2019 16:27
Convert segmentation HDF to .mod file appropriate for imod.
"""
Script to convert eman2 segmentation hdf maps to imod model files at a user defined contour level.
Requires python>=3.5 as well as having Eman2 and IMOD in the path.
Usage: `python3 tomoseg_to_imod.py -i EXAMPLE.hdf -o EXAMPLE.mod -t 0.8`
Author: Benjamin Barad <benjamin.barad@gmail.com>
"""
import argparse
#!/bin/bash
if [[ ! -d 3DEM ]]
then
mkdir 3DEM
fi
cd 3DEM
curl -s http://mail.ncmir.ucsd.edu/pipermail/3dem/ |\