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)
import operator
from functools import reduce
results = qs.model.objects.raw(sql, sql_params)
obj_ranks = ( for obj in results)
return_objs = []
# inject rank
for obj_id, objs.items():
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".

wget -N -r -l1 -Nc -nd -A "33c3-*-eng-*-hd.webm"
poppingtonic / geekout_jam.rb
Last active Jan 1, 2017
Livecoding Snippet #2
View geekout_jam.rb
# Geek0ut! Witness me!
notes = (scale :e2, :minor_pentatonic, num_octaves: 2)
live_loop :feh do
with_fx :wobble, reps: 3, amp: 0.1 do
use_synth :tb303
play (ring :e1, :e2, :e3).tick - 12, release: 0.7, cutoff: rrand(70, 130)
sleep 0.125