Skip to content

Instantly share code, notes, and snippets.

View chrahunt's full-sized avatar

Chris Hunt chrahunt

View GitHub Profile
@chrahunt
chrahunt / README.md
Last active September 10, 2019 13:15
Python installation candidate handling

states.yml lists some possible states we can consider for installable candidates and how we can create new artifacts that give us more information during the installation process.

Conventions:

  1. If no action applies, than it's a failure
  2. If no conditional state within an action applies, then it's a failure

One possible implementation may look like:

Output of inspect.is* for all members of

class Example:
 @property
 def _property(self):
  pass
 async def _coroutine(self):
  pass
 async def _coroutinegen(self):
@chrahunt
chrahunt / ClientLibrary.py
Created September 8, 2018 13:56
Websocket test library example.
import asyncio
import functools
import inspect
import os
import re
import subprocess
import sys
import threading
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chrahunt
chrahunt / convert.js
Created December 13, 2016 02:19
Convert replays
const {ArgumentParser} = require('argparse');
const glob = require('glob');
const fs = require('fs');
const {round10} = require('round10');
function main() {
let parser = new ArgumentParser({ description: "minify replay files."});
parser.addArgument('glob');
let args = parser.parseArgs();
let stats = [];
@chrahunt
chrahunt / webp.js
Created November 23, 2016 02:27
Attempted whammy rewrite. Unusable.
/**
* Generates a WebM video from an array of WebP images by making all
* of them key frames.
* For references, see:
* * WebP container format: https://developers.google.com/speed/webp/docs/riff_container
* * VP8 spec: https://datatracker.ietf.org/doc/rfc6386/?include_text=1
* * EBML guide: https://matroska-org.github.io/libebml/specs.html
*
* To use in the browser, compile and pass to Blob constructor:
* blob = new Blob(video.compile(), { type: "video/webm" });
@chrahunt
chrahunt / Code.gs
Created May 30, 2016 05:56
Maps API in Google Sheets
var Properties = PropertiesService.getScriptProperties();
/**
* Return rate-limited function under specified delay.
* @param {Function} fn The function to wrap.
* @param {string} domain The domain under which to apply the delay.
* @param {number} delay Time (in ms) between successive calls.
* @return {Function} The function to call.
*/
function RateLimited(fn, domain, delay) {

Chapter 1 - Introduction

Focus questions: What is an OS and what does it do? How should we evaluate OSs and what are some of the trade-offs their designers face? What is the history of OSs and what new functionality will we see in future OSs?

1.1 Fact: Operating Systems solve problems that may be faced in many different situations. As such, the techniques, design patterns, and methods of dealing with these problems, and the complexity of the operating system itself, may be found useful in any large software application.

@chrahunt
chrahunt / listen.html
Last active January 7, 2016 03:38
Add speech recognition to TagPro.
<!DOCTYPE html>
<html>
<head></head>
<body>
<script>
console.log("Listener: Loading page.");
var TAGPRO_URLS = [
"http://tagpro-\\w*\\.koalabeast\\.com:\\d+",
"http://tagpro.gg:\\d+",
// ==UserScript==
// @name Fake Some Ball
// @namespace http://reddit.com/user/snaps_
// @description Better faking Some Ball. Never a name overlapped.
// @include http://tagpro-*.koalabeast.com:*
// @include http://maptest*.newcompte.fr:*
// @include http://tangent.jukejuice.com:*
// @license MIT
// @author snaps
// @version 0.1.0