Skip to content

Instantly share code, notes, and snippets.

View sampollard's full-sized avatar

Sam Pollard sampollard

View GitHub Profile
@sampollard
sampollard / all-unicode.py
Last active February 11, 2017 23:53
Save every printable unicode character to a file
# Enumerate every printable character
# It could be fun to find an interesting subset
from __future__ import print_function
import random
f = open("all.txt", "w")
for i in range(200000):
try:
f.write(unichr(i).encode("utf8"))
except ValueError:
pass
@sampollard
sampollard / productivity.sh
Last active December 24, 2018 23:13
Productivity Enhancer
#!/bin/bash
# usage: ./prod.sh <repository_url>
# Have no one doubt your productivity on GitHub. You must already have
# a repository and have an ssh key established for this to work.
# To get a nice solid green contribution, see
# https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile
REPO_URL=$1
git clone "$REPO_URL" ~/prod
cd ~/prod
if ! [ -f counter.txt ]; then
@sampollard
sampollard / GraphFileFormats.md
Last active April 14, 2021 05:08
Comprehensive filename extension for graph file formats

There are almost as many graph file formats as there are graph processing platforms. Here, I attempt to provide a comprehensive listing. Some of these are nearly trivial, but yet, the standards are just not established. Whether the vertices are 0-indexed or 1-indexed is undefined. However, this does matter for some systems such as GraphMat. All the examples show the same directed, unweighted graph with the exception of .metis.

ASCII Text Formats

.el

This is the "edge list" format. The format is one edge per line of the form . For example,

1 2
2 1
1 3
@sampollard
sampollard / minionize.sh
Created November 21, 2015 07:56
Add (feat. Minions) to every mp3 file song title
#!/bin/bash
for song in $(find ~ -iname *.mp3)
do
title=$(id3info $song | awk -F ':' '/TIT2/{print $NF}')
id3tag -s "$title (feat. Minions)" $song
done