Skip to content

Instantly share code, notes, and snippets.

View follesoe's full-sized avatar
📱
Working on Skredvarsel app

Jonas Follesø follesoe

📱
Working on Skredvarsel app
View GitHub Profile
@follesoe
follesoe / streaming.html
Created March 18, 2020 08:51
Blueye player HTML
<script type="text/javascript" src="//player.wowza.com/player/latest/wowzaplayer.min.js"></script>
<div id="playerElement"style="padding:0 0 56.25% 0"></div>
<script type="text/javascript">
var streamConfig = {
"license":"PLAY2-6VKVk-ZmzTk-UD7YP-BmNjc-4E3XN",
"sources":[
{
"sourceURL":"wss://edge.cdn.wowza.com/live/_definst_/0P0p2dVQ4K0JucG9zUjZTaUVSdFp5833/stream.ws"
},
{
public override void Show(MvxViewModelRequest request)
{
if (request.ViewModelType == typeof(SettingsViewModel))
{
var page = CreatePage(request);
var viewModel = LoadViewModel(request);
page.DataContext = viewModel;
var vc = page.CreateViewController();
var attr = new MvxTabPresentationAttribute
c:\FTS\Apps\blueye\Resources\P2-functional-tests>python test.py test_upload_swupdate
INFO test_upload_swupdate: starting
Traceback (most recent call last):
File "test.py", line 7, in <module>
exit(testcases.tests())
File "C:\Users\tczkkepa\AppData\Local\Programs\Python\Python36\lib\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "C:\Users\tczkkepa\AppData\Local\Programs\Python\Python36\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\tczkkepa\AppData\Local\Programs\Python\Python36\lib\site-packages\click\core.py", line 1066, in invoke
@follesoe
follesoe / ObservableZeroconf.cs
Created June 27, 2018 20:13
System.Reactive based Bonjour Browser
public class ObservableZeroconf : IObservableZeroconf
{
public ObservableZeroconf()
{
}
public IObservable<Service> Search(string serviceType)
{
var browser = new NSNetServiceBrowser();
browser.Schedule(NSRunLoop.Current, NSRunLoopMode.Default.ToString());
@follesoe
follesoe / Program.cs
Created June 25, 2018 18:30
Attempt at extending example further
static void Main(string[] args)
{
var browser = new ServiceBrowser();
var observableFound =
Observable.FromEventPattern<ServiceFoundEventArgs>(
h => browser.ServiceFound += h,
h => browser.ServiceFound -= h)
.Select(e => e.EventArgs.Service);
@follesoe
follesoe / Program.cs
Created June 23, 2018 13:44
Event Based API example - how to turn this into System.Reactive Observable<Service>?
using System;
using System.Reactive;
using System.Reactive.Linq;
using System.Threading.Tasks;
namespace ReactiveLearning
{
class Program
{
static void Main(string[] args)
@follesoe
follesoe / compass.js
Last active October 13, 2016 19:07
Silly implementation of compass UI in console to understand how to implement it.
function difference(a, b) {
var diff = b - a;
var absDiff = Math.abs(diff);
if (absDiff <= 180)
{
return absDiff == 180 ? absDiff : diff;
}
else if (b > a)
{
return absDiff - 360;
@follesoe
follesoe / FRAMEADV.S
Last active February 11, 2016 09:32
Forslag til kildekode på folie på glassvegg
*-------------------------------
*
* Draw entire 10 x 3 screen from scratch
*
*-------------------------------
SURE
lda #1
sta genCLS ;clear screen
jsr setback ;draw on bg plane
// This sample will guide you through elements of the F# language.
//
// *******************************************************************************************************
// To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click
// and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu.
// *******************************************************************************************************
//
// For more about F#, see:
// http://fsharp.org
//
open System.IO
let prices = File.ReadLines(__SOURCE_DIRECTORY__ + "/2/input.txt")
|> Seq.map System.Double.Parse
|> Seq.toList
let rec findMax price prices profit =
match prices with
| [] -> profit
| hd :: tail ->