Skip to content

Instantly share code, notes, and snippets.

@zrzka
zrzka / !IMPORTANT.md
Last active March 2, 2020 07:27 — forked from chockenberry/tot.sh
A shell script for Tot
@gruber
gruber / tot.sh
Last active July 1, 2022 13:58 — forked from chockenberry/tot.sh
A shell script for Tot
#!/bin/bash
# Fork of CHOCK's original tot.sh to add support for dot "0" to target
# the first empty dot.
# https://gist.github.com/chockenberry/d33ef5b6e6da4a3e4aa9b07b093d3c23
#
# 2 Mar 2020
# + Incorporated suggestions from ShellCheck (https://www.shellcheck.net).
# Thanks to Ramsey Dow.
# + Changed call to `python` to `/usr/bin/python` to get Python 2, avoiding
@chockenberry
chockenberry / tot.sh
Last active October 6, 2023 12:23
A shell script for Tot
#!/bin/sh
basename=`basename $0`
if [ -z "$*" ]; then
echo "usage: ${basename} <dot> [ -o | -r | <file> | - ]"
echo ""
echo "options:"
echo " -o open dot in window with keyboard focus"
echo " -r read contents of dot"
@veltman
veltman / README.md
Created July 11, 2016 03:05
Argyle

Infinite argyle with random ColorBrewer and d3 4.0 color scales.

@nicwolff
nicwolff / XML_breaker.py
Last active March 14, 2024 02:11
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
@arfon
arfon / github_api_doi.md
Created March 19, 2014 00:34
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
@willurd
willurd / web-servers.md
Last active May 10, 2024 05:14
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@bunkat
bunkat / index.html
Last active January 10, 2024 18:18
Swimlane Chart using d3.js
<!--
The MIT License (MIT)
Copyright (c) 2013 bill@bunkat.com
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
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream