Skip to content

Instantly share code, notes, and snippets.

View steve-ayerhart's full-sized avatar
💭
I write guile vaporware

Steve steve-ayerhart

💭
I write guile vaporware
View GitHub Profile
! Copyright (C) 2020 .
! See http://factorcode.org/license.txt for BSD license.
USING: endian sequences kernel classes.struct io io.binary io.files io.encodings io.encodings.string io.encodings.utf8 io.encodings.binary alien.c-types alien.endian math locals accessors prettyprint combinators pack math.parser strings arrays io.streams.byte-array sequences.generalizations assocs splitting ;
QUALIFIED: bitstreams
IN: flac
ALIAS: read-bit bitstreams:read
CONSTANT: FLAC-MAGIC "fLaC"
gboolean handle_element (GstBus *bus, GstMessage *msg, UserInterface *ui)
{
const GstStructure *s= gst_message_get_structure (msg);
guint band;
const GValue *magnitudes;
if (gst_structure_has_name (s, "spectrum"))
{
magnitudes = gst_structure_get_value (s, "magnitude");
gfloat *m;
@steve-ayerhart
steve-ayerhart / firmware.scm
Created September 27, 2018 22:35
Guixbook Pro
(define-module (bbbsd packages firmware)
#:use-module (guix download)
#:use-module (guix build-system trivial)
#:use-module (guix build-system gnu)
#:use-module (guix build utils)
#:use-module (guix utils)
#:use-module (guix packages)
#:use-module (gnu packages)
#:use-module (gnu packages python))
~/S/g/src/flac/.libs λ readelf -a audiofiles-flac.so
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: Advanced Micro Devices X86-64
#!/bin/bash
alias lstrmr=livestreamer-wrapper
alias twitch=twitch-wrapper
alias sc2=twitch-wrapper
twitch_sc2_endpoint='https://api.twitch.tv/kraken/streams?game=StarCraft+II&limit=10'
twitch_head='Accept: application/vnd.twitchtv.v3+json'
livestreamer-wrapper () {
#!/bin/bash
alias lstrmr=livestreamer-wrapper
alias twitch=twitch-wrapper
livestreamer-wrapper () {
livestreamer $1 best 1>/dev/null &
}
twitch-wrapper () {
alias lstrmr=livestreamer-wrapper
alias twitch=twitch-wrapper
livestreamer-wrapper () {
livestreamer $1 best 1>/dev/null &
}
twitch-wrapper () {
livestreamer-wrapper twitch.tv/$1
}
(require 'cl)
(request
"https://api.twitch.tv/kraken/streams"
:params '(("game" . "StarCraft II") ("limit" . "10"))
:parser 'json-read
:success (function*
(lambda (&key data &allow-other-keys)
(when data
(with-current-buffer (get-buffer-create "*Sc2 Streamers*")
(erase-buffer)
alias lstrmr=livestreamer-wrapper
alias twitch=twitch-wrapper
livestreamer-wrapper () {
livestreamer $1 best 1>/dev/null &
}
twitch-wrapper () {
livestreamer-wrapper twitch.tv/$1
}
sc2 () {
ruby -e 'require "json";JSON.parse(ARGV[0])["streams"][0..9].each{|s|printf("%s ", s["channel"]["name"])};puts' "$(curl -sH 'Accept: application/vnd.twitchtv.v3+json' -X GET https://api.twitch.tv/kraken/streams?game=StarCraft+II)"
}