Skip to content

Instantly share code, notes, and snippets.

Martin Walk MW3000

Block or report user

Report or block MW3000

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
MW3000 /
Created Nov 19, 2018 — forked from nicwolff/
Python script to break large XML files
import os
import sys
from xml.sax import parse
from xml.sax.saxutils import XMLGenerator
class CycleFile(object):
def __init__(self, filename):
self.basename, self.ext = os.path.splitext(filename)
self.index = 0
MW3000 / customViewPlayground.swift
Created Apr 3, 2018
NSView Subclass Template Playground (Swift 4.1, Xcode 9.3)
View customViewPlayground.swift
//: Playground - noun: a place where people can play
// Swift 4.1, Xcode 9.3
import Cocoa
import PlaygroundSupport
class CustomView: NSView {
override func draw(_ dirtyRect: NSRect) {
// Add your drawing code here.
MW3000 /
Created Sep 11, 2017
Search for filenames and file descriptions in DSpace

Search for filenames and file descriptions in DSpace

Out of the box discovery in DSpace 6 works quite well. But it does not include filenames and file descriptions in the search index.

As we plan to allow research data publications on our repository, there will be publications with many files (as opposed to text publications which usually consist of only one pdf) and it would be nice to be able to search for filenames and file descriptions.

Add additional fields and values to Solr index

Sometimes extending DSpace turns out to be very easy and straightforward, albeit not very well documented.

To add fields and values to the discovery index, just create a new implementation of the SolrServiceIndexPlugin class and add your fields and values to the document in the additionalIndex method:

MW3000 / _tint-and-shade.scss
Created Jan 5, 2017 — forked from benfrain/_tint-and-shade.scss
Tint and Shade functions for Sass
View _tint-and-shade.scss
// Add percentage of white to a color
@function tint($color, $percent){
@return mix(white, $color, $percent);
// Add percentage of black to a color
@function shade($color, $percent){
@return mix(black, $color, $percent);
MW3000 /
Created Jul 28, 2016 — forked from arfon/
Building a data archiving service using the GitHub API, figshare and Zenodo

Building a data archiving service using the GitHub API, figshare and Zenodo

Over the past couple of weeks we've seen a couple of great examples of service integrations from figshare and Zenodo that use the GitHub outbound API to automatically archive GitHub repositories. While the implementation of each solution is likely to be somewhat different I thought it might be useful to write up in general terms how to go about building such a service.

In a nutshell we need a tool that does the following:

  • Authenticates against the GitHub API
  • Configures an outbound API endpoint for repository events to be posted to
  • Respond to a GitHub repository event by grabbing a copy of the code
  • Issues a DOI for the code bundle
MW3000 / index.html
Created Jun 18, 2016 — forked from bunkat/index.html
Swimlane Chart using d3.js
View index.html
The MIT License (MIT)
Copyright (c) 2013
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
MW3000 /
Last active Feb 20, 2016
D3 interactive histogram

D3 interactive histogram

Das Diagramm zeigt das Tweetaufkommen zum Hashtag #Landesverrat am 31. Juli 2015 von 9:30 Uhr bis 15:30 Uhr.

Ein Klick auf ein Portrait zeigt das Tweetaufkommen in Verbindung mit dem Namen des jeweiligen Akteurs.


MW3000 / gist:f2db4d76a7af2027ba73
Created Sep 25, 2014
Marcus Zarra’s logging macros.
View gist:f2db4d76a7af2027ba73
// Marcus Zarra's logging macros.
#ifdef DEBUG
#define DLog(...) NSLog(@"%s(%p) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__])
#define DCLog(...) NSLog(@"%@", [NSString stringWithFormat:__VA_ARGS__])
#define ALog(...) {NSLog(@"%s(%p) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__]);[[NSAssertionHandler currentHandler] handleFailureInFunction:[NSString stringWithCString:__PRETTY_FUNCTION__ encoding:NSUTF8StringEncoding] file:[NSString stringWithCString:__FILE__ encoding:NSUTF8StringEncoding] lineNumber:__LINE__ description:__VA_ARGS__];}
#define DLog(...) do { } while (0)
#define DCLog(...) do { } while (0)
You can’t perform that action at this time.