This file contains hidden or 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
// in my controller, the function executed when a tweet is received (this works, I verified by logging the tab) | |
function(e) { | |
$scope.tweetStream.unshift(angular.fromJson(e.data)) | |
} | |
// in my view | |
<ion-view view-title="Tweets"> | |
<ion-content> | |
<div class="list"> |
This file contains hidden or 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
func (sh StreamHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request) { | |
es := eventsource.New( | |
&eventsource.Settings{ | |
Timeout: 2 * time.Second, | |
CloseOnTimeout: true, | |
IdleTimeout: 2 * time.Second, | |
Gzip: true, | |
}, | |
func(req *http.Request) [][]byte { |
This file contains hidden or 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
<head> | |
<title>SWFObject 2 dynamic publishing example page</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
<link href="bin/video-js.css" rel="stylesheet"> | |
<script src="bin/video.js"></script> | |
<script src="bin/swfobject.js"></script> | |
<link href="bin/videojs-vast-vpaid.css" rel="stylesheet"> |
This file contains hidden or 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
angular.module('app') | |
/* | |
Manages the global audio player with the HTML5 audio player | |
See HTML5 audio player API : http://www.w3schools.com/tags/ref_av_dom.asp | |
*/ | |
.factory('Player', function ($rootScope, Station, Error, $document, $window) { | |
return { | |
player : $document[0].createElement('audio'), |
This file contains hidden or 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
cmdStr := "thumbnail.sh " + url | |
cmd := exec.Command("/bin/sh", "-c", cmdStr) | |
_, err := cmd.Output() | |
if err != nil { | |
println(err.Error()) | |
return | |
} |
This file contains hidden or 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
// makes a request to a service with the get parameters passed in parameter | |
// returns a Response struct containing the response | |
func getVastPlayer(v url.Values) (Response, float64, error) { | |
resp := Response{} | |
u := VAST_URL + v.Encode() | |
t1 := time.Now() | |
myresp, err := http.Get(u) | |
defer myresp.Body.Close() |