Skip to content

Instantly share code, notes, and snippets.

Avatar

Stephen Brennan brenns10

View GitHub Profile
View 0001-fs-when-reading-mp3-files-only-play-Shake-It-Off.patch
From 38c48252f528b00ba0b4fd2d1a364b91c694a4ac Mon Sep 17 00:00:00 2001
From: Stephen Brennan <stephen@brennan.io>
Date: Thu, 28 Dec 2017 15:14:59 -0800
Subject: [PATCH] fs: when reading mp3 files, only play Shake It Off
---
fs/open.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/fs/open.c b/fs/open.c
@brenns10
brenns10 / PKGBUILD
Created Mar 3, 2017
Patched Python for vido
View PKGBUILD
# $Id: PKGBUILD 286731 2017-01-16 12:41:55Z svenstaro $
# Maintainer: Angel Velasquez <angvp@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Jason Chu <jason@archlinux.org>
pkgname=python
pkgver=3.6.0
pkgrel=3
@brenns10
brenns10 / Makefile
Last active Mar 20, 2021
Linux Character Device Example
View Makefile
obj-m += chardev.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
View keybase.md

Keybase proof

I hereby claim:

  • I am brenns10 on github.
  • I am brenns10 (https://keybase.io/brenns10) on keybase.
  • I have a public key ASBjoRLIjZK9BV0c_NIwwWhkWczCtetsy8vAfDcVvEkLaQo

To claim this, I am signing this object:

@brenns10
brenns10 / Labor Statistics.ipynb
Last active Apr 1, 2016
Gender Diversity in the Workforce
View Labor Statistics.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brenns10
brenns10 / alphabet.py
Created Nov 18, 2015
Determine Ordering of Alphabet
View alphabet.py
"""
Code to return the alphabet in which a list of words is sorted.
Imagine that you are given a list of words (eg: best friends forever), along
with the claim that these words are lexicographically sorted for *some*
alphabet. Your job is to determine whether this is true, and if it is, return
an example of such an alphabet.
This module implements an algorithm to solve this problem. It creates a graph
of dependencies between letters, performs a topological sort, and then returns
@brenns10
brenns10 / spawner.py
Last active Nov 18, 2015
Tmux Job Spawner
View spawner.py
#!/usr/bin/env python3
"""
Run a list of commands in tmux.
"""
from subprocess import call
from os.path import realpath, isfile
from uuid import uuid4
from datetime import datetime
import os, sys
@brenns10
brenns10 / gambler.py
Last active Oct 16, 2015
Gambling Chip Algorithm
View gambler.py
"""
Finds optimal strategy for gambling chip game.
Problem: two players (Alice and Bob) play a game where gambling chips (with
numeric values) are laid out in a line. They alternate turns. During their
turn, a player picks up a chip on either end of the line, but not from anywhere
in the middle, and adds that chip to their collection. At the end, the player
with the higher valued collection of chips wins.
This is a dynamic programming algorithm for solving the problem. It runs in
@brenns10
brenns10 / .travis.yml
Last active Feb 1, 2020
Travis Sphinx Auto-Doc
View .travis.yml
language: python
python:
- 3.5
install:
- pip install sphinx sphinx_rtd_theme
script: make html
after_success:
- ./push.sh
env:
global:
@brenns10
brenns10 / linkedlist.c
Last active Sep 22, 2015
Linked List in C
View linkedlist.c
#include <stdio.h>
#include <stdlib.h>
struct node {
int value;
struct node *next;
};
void ll_print(struct node *list)
{