This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias dark=$HOME/bin/dark.sh | |
alias light=$HOME/bin/light.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# completion for tmux session names | |
function _tmux_complete_session() { | |
local cur | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
COMPREPLY=( $(compgen -W "$(tmux ls | cut -f 1 -d ':')" -- "${cur}") ) | |
} | |
alias td='tmux a -d -t' | |
complete -F _tmux_complete_session td |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "sinatra" | |
get '/' do | |
erb :index | |
end | |
get '/stream', provides: "text/event-stream" do | |
puts "hi" | |
stream(:keep_open) do |out| | |
1000.times do |i| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
possible solutions | |
=================== | |
1. On the server side, make a request to the stream with this request header: | |
Icy-MetaData:1 | |
This will return a response header like this: | |
icy-metaint:8192 | |
This supposedly tells you there is a metadata packet in the stream every 8192 bytes. | |
You could read in the metadata in a program on the server this way, and when it changes, | |
send a message to the client using SSEs or something. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set("log.file",false) | |
set("log.stdout",true) | |
set("log.level",3) | |
set("harbor.bind_addr","0.0.0.0") | |
def harbor_connect(headers) | |
log(headers) | |
log("harbor connect") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Datafruits < Sinatra::Base | |
@@my_app = {} | |
def self.new(*) self < Datafruits ? super : Rack::URLMap.new(@@my_app) end | |
def self.map(url) @@my_app[url] = self end | |
# do all config stuff in this file | |
enable :sessions | |
use Rack::Flash | |
class ApplicationController < Datafruits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* redis pub/sub | |
* no support for redis in liquidsoap, could call a ruby script? | |
* osc? | |
* supported directly in liquidsoap | |
* unix socket | |
* would require local sinatra app to communicate with the outside world | |
* write to file, poll filesystem with fs-events gem | |
* would require local sinatra app to communicate with the outside world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
█▓▒░tony@kiwi░▒▓█ ~$ curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST -d '{"user":{"login":"tony", "password":"f0ibles1"}}' http://localhost:3000/login | |
HTTP/1.1 406 Not Acceptable | |
Content-Type: application/json; charset=utf-8 | |
X-Ua-Compatible: IE=Edge | |
Cache-Control: no-cache | |
X-Request-Id: e0d06fea7951ed28ecd1c788612f55e9 | |
X-Runtime: 0.151305 | |
Server: WEBrick/1.3.1 (Ruby/1.9.3/2013-02-13) | |
Date: Sat, 30 Mar 2013 20:51:24 GMT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Resque | |
module Failure | |
class Base | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make[1]: Entering directory `/z/src/butt-0.1.12/src' | |
g++ -o butt FLTK/Fl_ILM216.o FLTK/Fl_Native_File_Chooser.o FLTK/fl_callbacks.o F | |
LTK/fl_funcs.o FLTK/flgui.o butt.o cfg.o icecast.o lame_encode.o parseconfig.o p | |
ort_audio.o ringbuffer.o shoutcast.o sockfuncs.o strfuncs.o timer.o util.o vorbi | |
s_encode.o wav_header.o -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -lmp | |
3lame -L/usr/local/lib `` -lpthreadGC2 -lportaudio -mwindows /usr/local/lib/ | |
libfltk_images.a /usr/local/lib/libfltk_png.a /usr/local/lib/libfltk_z.a /usr/lo | |
cal/lib/libfltk_jpeg.a /usr/local/lib/libfltk.a -lole32 -luuid -lcomctl32 -lvorb | |
isenc -lvorbis -logg -lws2_32 -lmp3lame | |
FLTK/Fl_ILM216.o: In function `ZN9Fl_ILM2166handleEi': |