Skip to content

Instantly share code, notes, and snippets.

@MW3000
MW3000 / tot.sh
Last active November 27, 2020 19:37 — forked from chockenberry/tot.sh
A shell script for Tot
#!/usr/bin/env bash
# Fork of zrzk's tot.sh https://gist.github.com/zrzka/5948256ac72c3f3820aebff1fb4b1b70
# which is a fork of gruber's tot.sh https://gist.github.com/gruber/b18d8b53385fa612713754799ed4d0a2
# which is a fork of chockenberry's tot.sh https://gist.github.com/chockenberry/d33ef5b6e6da4a3e4aa9b07b093d3c23
# Add possibility to access dots by default color names in addition to numbers and
# access first empty dot by 'empty' in addition to 0.
# Exit immediately if a pipeline returns a non-zero status.
@MW3000
MW3000 / XML_breaker.py
Created November 19, 2018 09:39 — forked from nicwolff/XML_breaker.py
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
MW3000 / _tint-and-shade.scss
Created January 5, 2017 14:21
Tint and Shade functions for Sass
// 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
MW3000 / github_api_doi.md
Created July 28, 2016 12:06 — forked from arfon/github_api_doi.md
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
MW3000 / index.html
Created June 18, 2016 06:59 — forked from bunkat/index.html
Swimlane Chart using d3.js
<!--
The MIT License (MIT)
Copyright (c) 2013 [email protected]
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