Skip to content

Instantly share code, notes, and snippets.

@ains
ains / flac_haders.py
Created September 17, 2016 20:55
Python code to write FLAC mandatory headers for a stream (adapted from mutagen code)
import struct
from StringIO import StringIO
def write_flac_header(sample_rate, channels, bits_per_sample):
total_samples = 0
f = StringIO()
# write FLAC header
f.write("fLaC")

Keybase proof

I hereby claim:

  • I am ains on github.
  • I am ains (https://keybase.io/ains) on keybase.
  • I have a public key ASAD8rcFG1lvuh7Sd1ziBuZerdcGTaKpwQUOHym_NxkvzAo

To claim this, I am signing this object:

@ains
ains / index.html
Created March 31, 2015 13:40
Code for "Things Which Aren't Magic - JSONP"
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
</body>
@ains
ains / bootstrap-persist-hover.js
Last active December 17, 2015 22:39
Holding a bootstrap popover open until the mouse enters the popover element. Adapted from StackOverflow answer to "How can I hold Twitter Bootstrap Popover open until my mouse moves into it?" (http://stackoverflow.com/a/9400740)
$(function () {
$("[rel=popover]")
.popover({
delay: 500,
offset: 10,
trigger: 'manual',
animate: false,
html: true,
template: '<div class="popover" onmouseover="clearTimeout($(this).data(\'hideTimeout\'));$(this).mouseleave(function() {$(this).hide(); });"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'