Skip to content

Instantly share code, notes, and snippets.

View mattmahn's full-sized avatar

Matt Mahnke mattmahn

View GitHub Profile
@mattmahn
mattmahn / BallsInPyramid.py
Created August 25, 2013 04:10
Calculates the number of balls stacker in the shape of a triangular pyramid given the number of layers
def count_layer(layer):
""" Returns the number of balls in a layer """
if layer == 0:
return 0
else:
return count_layer(layer-1) + layer
def count_pyramid(numLayers):
currentLayer = 0
numBalls = 0
#!/usr/bin/env python3
# coding=utf-8
from __future__ import print_function
import os
import json
import Queue
import socket
import threading
import time

Keybase proof

I hereby claim:

  • I am mattmahn on github.
  • I am mattmahn (https://keybase.io/mattmahn) on keybase.
  • I have a public key ASBmzl-_JIJnHuudnWER9_wFYEgLJAB-xW6VzbXmHQ-L3Ao

To claim this, I am signing this object:

chdir(/etc)
fchdir() to previous dir
sourcing "/etc/vimrc"
Searching for "archlinux.vim" in "/home/matt/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vimfiles/after,/home/matt/.vim/after"
Searching for "/home/matt/.vim/archlinux.vim"
Searching for "/usr/share/vim/vimfiles/archlinux.vim"
chdir(/usr/share/vim/vimfiles)
fchdir() to previous dir
line 11: sourcing "/usr/share/vim/vimfiles/archlinux.vim"
#include <chrono>
#include <cstdlib>
#include <iostream>
#include <signal.h>
#include <string>
#include <unistd.h>
volatile double sum = 0;
std::chrono::system_clock::time_point start_time;
#!/usr/bin/env node
const crypto = require('crypto');
const NUM = 3e5;
function SnH(password, salt) {
return new Promise((resolve) => {
let originalSalt = salt;
password = Buffer.from(password);
import React from 'react';
import config from 'config';
import moment from 'moment-timezone';
import { readAddress } from 'consus-core';
import ItemStore from '../../store/item-store';
import ListenerComponent from '../../lib/listener-component.jsx';
import ModelStore from '../../store/model-store';
import OmnibarController from '../../controllers/components/omnibar';
import StudentPanelController from '../../controllers/components/student-panel';
72,73c72,73
< if [ -d `cd "/${ISO_FILENAME%/*}" /dev/null 2>&1; echo "${PWD}"` ]; then
< ISO_FILENAME=`cd "/${ISO_FILENAME%/*}" /dev/null 2>&1; echo "${PWD}/${ISO_FILENAME##*/}"`
---
> if [ -d `cd "/${ISO_FILENAME%/*}" >/dev/null 2>&1; echo "${PWD}"` ]; then
> ISO_FILENAME=`cd "/${ISO_FILENAME%/*}" >/dev/null 2>&1; echo "${PWD}/${ISO_FILENAME##*/}"`
113c113
< "$MKISOFS" -iso-level 4 -l -r -J -joliet-long -D -V "${VOLUME_ID}" \
---
> "$MKISOFS" -iso-level 3 -l -r -J -joliet-long -D -V "${VOLUME_ID}" \
#!/usr/bin/env python3
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version π, September 2017
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@mattmahn
mattmahn / GNU_WSL.80.txt
Last active March 14, 2019 18:57
GNU/'Windows Subsystem for Linux'
What you are referring to as Linux, is in fact, GNU/'Windows Subsystem for
Linux', or as I've recently taken to calling it, GNU plus Windows. Linux is not
an operating system unto itself, but rather another free component of a fully
functioning GNU system. Many computer users run a modified version of the GNU
system every day, without realizing it. Through a peculiar turn of events, the
version of GNU which is widely used today is often called "Linux", and many of
its users are not aware that it is basically the GNU system. There really is
a Linux, but it is just a part of the system they use. Linux is the kernel: the
program in the system that allocates the machine's resources to the other
programs that you run. The kernel is an essential part of an operating system,