Skip to content

Instantly share code, notes, and snippets.

Making my way downtown

Brian Muhia poppingtonic

Making my way downtown
View GitHub Profile
poppingtonic /
Created Aug 4, 2017 — forked from fabianp/
Pairwise ranking using scikit-learn LinearSVC
Implementation of pairwise ranking using scikit-learn LinearSVC
"Large Margin Rank Boundaries for Ordinal Regression", R. Herbrich,
T. Graepel, K. Obermayer 1999
"Learning to rank from medical imaging data." Pedregosa, Fabian, et al.,
Machine Learning in Medical Imaging 2012.
poppingtonic / README
Created Mar 22, 2017 — forked from mikaelz/README
Fill MPC/MPD playlist with SoundCloud stream URLs
Options: --genre search user tracks url playlist
View factorial.lua
-- defines a factorial function
function fact (n)
if n <= 0 then
return 1
return n * fact(n-1)
poppingtonic /
Created Mar 2, 2017 — forked from mocobeta/
Python script importing Wikipedia xml dump data to PostgreSQL
# -*- coding: utf-8 -*-
import psycopg2
import xml.sax
from xml.sax.handler import ContentHandler
from dicttoxml import dicttoxml
INSERT_STMT = "INSERT INTO pages (id, page) VALUES('%s', '%s')"
poppingtonic /
Created Feb 6, 2017 — forked from karpathy/
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
poppingtonic / ffmpeg-desktop-livestreaming-nvenc-and This gist will show you how to livestream your Linux desktop to a client via FFMpeg using a GPU-accelerated video encoder (NVENC and VAAPI-based)
View ffmpeg-desktop-livestreaming-nvenc-and

Low-Latency Live Streaming for your Desktop using ffmpeg and netcat


In this post I will explore how to stream a video and audio capture from one computer to another using ffmpeg and netcat, with a latency below 100ms, which is good enough for presentations and general purpose remote display tasks on a local network.

The problem:

poppingtonic / VAAPI-hwaccel-encode-Linux-Ffmpeg& This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.
View VAAPI-hwaccel-encode-Linux-Ffmpeg&

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

View types.markdown


A type is a collection of possible values. An integer can have values 0, 1, 2, 3, etc.; a boolean can have values true and false. We can imagine any type we like: for example, a HighFive type that allows the values "hi" or 5, but nothing else. It's not a string and it's not an integer; it's its own, separate type.

Statically typed languages constrain variables' types: the programming language might know, for example, that x is an Integer. In that case, the programmer isn't allowed to say x = true; that would be an invalid program. The compiler will refuse to compile it, so we can't even run it.

View free security

Simple Security Guidelines

  • Use an iDevice

    • Use an iPod or an iPad without a SIM card
    • Use an iPhone
    • Do not jailbreak
    • Always upgrade to new iOS versions
  • Use Signal (iOS + Android)

poppingtonic /
Created Jun 6, 2016 — forked from csvoss/
English to Tengwar transliterator
# This file converts English text to Tengwar, using my own personal
# preferences for transliterating Tengwar.
# Currently, the output that is created is intended for use with the Tengwar
# Annatar font and related font families.
# Example usage:
# >>> print convert("This was a triumph. I'm making a note here: huge success!")
# -- then paste the resulting text into a document rendered in Tengwar Annatar.