Skip to content

Instantly share code, notes, and snippets.

@barrbrain
barrbrain / commit-msg
Last active December 19, 2015 09:18
git hooks to CYA when using hg-git mode with git-remote-hg
#!/bin/sh
test "2" = `grep -e '^--HG--$' -e '^branch : [^ ][^ ]*$' "$1"|wc -l` || {
echo >&2 Missing hg branch specification.
exit 1
}
@barrbrain
barrbrain / spider.rb
Last active December 19, 2015 09:39
A quick and dirt external site crawler using capybara-mechanise.
require 'capybara/mechanize'
require 'sinatra/base'
Capybara.run_server = false
Capybara.current_driver = :mechanize
class TestApp < Sinatra::Base; get '/' do; end end
Capybara.app = TestApp
Capybara.app_host = "http://127.0.0.1/"
class Spider
@barrbrain
barrbrain / filter.js
Last active April 9, 2016 08:13 — forked from anonymous/filter.lljs
ll.js based daala technology demos
/*Daala video codec
Copyright (c) 2003-2010 Daala project contributors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
@barrbrain
barrbrain / Median of the maximum of independent poisson random variables.ipynb
Last active January 23, 2017 14:08
Median of the maximum of independent poisson random variables
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@barrbrain
barrbrain / AV1 PVQ delta rate analysis.ipynb
Last active February 15, 2017 13:32
Simulate Daala quantization-bitrate trends for subset3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@barrbrain
barrbrain / Chroma from Luma Basis Functions.ipynb
Last active August 3, 2017 15:43
Chroma from Luma Basis Functions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@barrbrain
barrbrain / S3TC style color quantization.ipynb
Created August 11, 2017 16:41
S3TC style color quantization
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@barrbrain
barrbrain / Sudoku.ipynb
Created January 9, 2018 14:59
Exploring Sudoku solving in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.