This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:repl_filetype_commands = { | |
\ 'javascript': 'node', | |
\ 'python': 'ipython --no-autoindent', | |
\ } | |
let g:repl_split = 'right' | |
nnoremap <silent> +re :ReplToggle<CR> | |
augroup python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# | |
# Author: Gaute Hope (gaute.hope@nersc.no) / 2015 | |
# | |
# based on example from matlab sinc function and | |
# interpolate.m by H. Hobæk (1994). | |
# | |
# this implementation is similar to the matlab sinc-example, but | |
# calculates the values sequentially and not as a single matrix | |
# matrix operation for all the values. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy.lib.format import open_memmap | |
shape = (1, 20, 600, 2160) | |
dtype = np.float32 | |
# Open a memory mapped numpy formatted file for a temporary variable | |
data = open_memmap('temp.npy', dtype = dtype, mode = 'w+', shape = shape) | |
data[:] = np.random.rand(*shape) | |
data.flush() # force write disk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8- -*- | |
# from: http://piao-tech.blogspot.no/2010/03/get-offlineimap-working-with-non-ascii.html#resources | |
import binascii | |
import codecs | |
# encoding | |
def modified_base64 (s): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! bash | |
# | |
# From: https://askubuntu.com/a/985386 | |
echo -e '\e[1mbold\e[22m' | |
echo -e '\e[2mdim\e[22m' | |
echo -e '\e[3mitalic\e[23m' | |
echo -e '\e[4munderline\e[24m' | |
echo -e '\e[4:1mthis is also underline (new in 0.52)\e[4:0m' | |
echo -e '\e[21mdouble underline (new in 0.52)\e[24m' | |
echo -e '\e[4:2mthis is also double underline (new in 0.52)\e[4:0m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* crypttest.cs: Demonstrates how to serialize and encrypt any object | |
* | |
* Gaute Hope <eg@gaute.vetsj.com> | |
* | |
* To deserialize it you need to know the unencrypted serialized length. | |
* So to store or send also pass the length, e.g. create a struct like this: | |
* | |
* public struct EncryptedObject { | |
* public int length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ---------------------------------------------------------------------------- | |
" DiffRev | |
" ---------------------------------------------------------------------------- | |
let s:git_status_dictionary = { | |
\ "A": "Added", | |
\ "B": "Broken", | |
\ "C": "Copied", | |
\ "D": "Deleted", | |
\ "M": "Modified", | |
\ "R": "Renamed", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# | |
# Author: Gaute Hope <eg@gaute.vetsj.com> / 2017-10-08 | |
import os, sys, os.path | |
import subprocess | |
import notmuch | |
import email | |
import email.parser | |
import email.policy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# do a quick check if there are new messages in a gmail account | |
# | |
# based on: http://cpbl.wordpress.com/2011/11/16/how-to-alpine-maildir-offlineimap/ | |
# | |
# Gaute Hope / 2013-12-13 / eg@gaute.vetsj.com | |
# | |
# requires: curl | |
# |
NewerOlder