Skip to content

Instantly share code, notes, and snippets.

View achilleas-k's full-sized avatar
🕹️

Achilleas Koutsou achilleas-k

🕹️
View GitHub Profile
import os
import sys
import re
from subprocess import check_output, call, CalledProcessError
from difflib import Differ
import requests
import json
red_begin = "\033[91m"
red_end = "\033[0m"
#!/bin/bash
# exit on error
set -e
# run go test in each package that contains test files (once per package only)
find -iname "*test.go" -execdir [ ! -e covprof.part ] \; -execdir go test -v -covermode=count -coverprofile=covprof.part \;
# prepare global coverage profile
echo "mode: count" > profile.cov
#!/usr/bin/bash
set -e
gitconfig=(
"user.name annextester"
"user.email [email protected]"
"annex.addunlocked true"
"annex.largefiles largerthan=10M"
"annex.backends WORM"
import smtplib
session = smtplib.SMTP('smtp.gmail.com', 587)
session.starttls()
session.login("username", "password")
subject = "Subject"
headers = ("From: {fromaddress}\n"
"To: {toaddress}\n"
"Subject: {subject}\n"
"mime-version: 1.0\n"
@achilleas-k
achilleas-k / usage_test.sh
Last active February 15, 2017 16:24
Shell script for testing the command line interface to GIN
#!/usr/bin/bash
set -e
user=achilleas
reponame=test-repo-${RANDOM}
dirone=/tmp/gin-test-repos/directory-one
dirtwo=/tmp/gin-test-repos/directory-two
cdprint() {
:: GIN client local setup for Windows
::
:: This file should be part of the gin client Windows bundle The purpose of the
:: file is to set up the environment and client configuration so that the
:: command line client can be used out of the box, without the need to install
:: or configure any packages.
::
:: The following actions are taken:
::
:: - The gin configuration file (config.yml) is created and the binary paths
import neo
import nixio as nix
import quantities as pq
import numpy as np
import time
import matplotlib.pyplot as plt
import cProfile
# n_segs = 150
# IMAP STUFF
source ~/keys/muttpass
set imap_user = $my_login
set imap_pass = $my_pass
set folder = imaps://mailin.lrz.de:993/
set spoolfile = +Inbox
mailboxes = +Inbox +Inbox.Archive +Inbox.Drafts +Inbox.Sent +Inbox.Junk +Inbox.Trash
set header_cache = ~/.cache/mutt
set message_cachedir = ~/.cache/mutt
import nixio as nix
from time import time
from uuid import uuid4
import matplotlib.pyplot as plt
import numpy as np
def verify_file(backend, N):
print("Verifying file")
nixfile = nix.File.open("/tmp/append-test.h5", nix.FileMode.ReadOnly,
#include <nix.hpp>
int main(){
nix::File file = nix::File::open("append_bug.nix", nix::FileMode::Overwrite);
nix::Block bone = file.createBlock("One", "test");
nix::Block btwo = file.createBlock("Two", "test");
nix::DataArray done = bone.createDataArray("DATA", "test", nix::DataType::Double, {1});
nix::DataArray dtwo = btwo.createDataArray("DATA", "test", nix::DataType::Double, {1}); // same name