Skip to content

Instantly share code, notes, and snippets.

@ssig33
Created June 10, 2012 11:46
Show Gist options
  • Select an option

  • Save ssig33/2905106 to your computer and use it in GitHub Desktop.

Select an option

Save ssig33/2905106 to your computer and use it in GitHub Desktop.
require 'sinatra'
require 'thread'
require 'haml'
$q = Queue.new
Thread.start {
while r = $q.pop
system 'say -v Victoria pin pon'
end
}
get '/' do
haml :index
end
get '/push' do
$q.push 'fuck'
'true'
end
__END__
@@index
<!DOCTYPE html>
<link href='http://ssig33.com/common.css' media='screen' rel='stylesheet' type='text/css' />
<meta content='width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' name='viewport' />
<script src='http://ssig33.com/jquery.js'></script>
%title インターフォン
%h1 インターフォン
%button 押す
:javascript
$('button').click(function(){
$.get('/push')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment