Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Japanuspus
Japanuspus / lectiolize.py
Last active August 29, 2015 14:01
A python script for preparing files for upload to the Lectio system by adding student numbers to file names based on a reference folder
#!/usr/bin/env python2.7
"""
Lectiolize: A python script for preparing files for upload to the Lectio system
by adding student numbers to file names based on a reference folder.
(C) janus@insignificancegalore.net, 2014
"""
from collections import namedtuple
import re
@Japanuspus
Japanuspus / volumiosetup.sh
Created April 25, 2015 19:06
Shell script for Volumio config
echo 'Doing stuff'
@Japanuspus
Japanuspus / main.rs
Created December 4, 2019 15:02
Create iterator that returns lenghts of runs of identical elements of slice
use std::iter;
fn run_lengths<'a, T>(a: &'a[T]) -> impl Iterator<Item=usize> + 'a
where
T: std::cmp::PartialEq
{
a
.windows(2)
.enumerate()
.filter_map(|(i, ab)| if ab[0]==ab[1] {None} else {Some(i as isize)})
@Japanuspus
Japanuspus / device_flow.py
Created May 25, 2020 12:45
Example of python CLI application using the device-code flow to authorize against login.microsoft.com
import requests
import json
from pathlib import Path
import time
import subprocess
import re
from datetime import datetime
import logging
import argparse
@Japanuspus
Japanuspus / float_string_performance.ipynb
Last active July 8, 2020 04:31
Performance of np.array for parsing list of strings
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Japanuspus
Japanuspus / numba jitclasses.ipynb
Created July 10, 2020 06:26
Heterogeneous dispatch with numba can be fast
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Japanuspus
Japanuspus / passion.ipynb
Created August 13, 2020 05:11
Solving a nonogram
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<html>
<head>
<title>Labyrinten</title>
</head>
<body>
<script>
function dragstart_handler(ev) {
ev.dataTransfer.setData("text/plain", ev.target.id);
}
function dragover_handler(ev) {
'
' Reply To All in Plain Text, with Linux-style quoting
'
' This allows you to use Outlook to reply to a mailinglist
'
' Copyright 2009 Matthijs van de Water
'
Sub ReplyAllPlain()
Dim app As New Outlook.Application