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
#if INTERACTIVE | |
#r "bin/Debug/FSharp.Data.dll" | |
#r "bin/Debug/FSharp.Charting.dll" | |
#r "bin/Debug/ServiceStack.Common.dll" | |
#r "bin/Debug/ServiceStack.Interfaces.dll" | |
#r "bin/Debug/ServiceStack.Text.dll" | |
#r "bin/Debug/ServiceStack.Redis.dll" | |
#load "../packages/FSharp.Charting.0.90.5/FSharp.Charting.fsx" | |
#endif | |
open System.IO |
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
defmodule Flightlog.Math do | |
def greatCircle(a,b) do | |
lat1 = elem(a, 0) | |
lon1 = elem(a, 1) | |
lat2 = elem(b, 0) | |
lon2 = elem(b, 1) | |
rlat1 = :math.pi * lat1 / 180.0 | |
rlat2 = :math.pi * lat2 / 180.0 | |
theta = lon1 - lon2 |
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
defmodule Flightlog.FlightView do | |
use Flightlog.Web, :view | |
def download(airport) do | |
url = "https://airportapi02560c297e8.azurewebsites.net/api/Airports?code=gEjAp7qIbRDJRJYFYxcgZ1bl1sqCPaTBPsZLVxy5MGHRNFEU79etKw==&iataCode=" <> airport | |
response = HTTPotion.get url | |
{status, fields} = JSON.decode(response.body) | |
fields | |
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
var beacon = require('beacon-pie'); | |
console.log("Wait for the UART to initialize"); | |
setTimeout(function() { | |
console.log("UART should be ready by now"); | |
// setting first advertiser with power 4db, 400ms interval, Local Name "Test" | |
beacon.setAdvertisingPacket(1, 4, 400, "Test"); | |
// same settings for 2nd advetiser, with bigger granularity |
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
#r "System.Net.Http" | |
#r "Newtonsoft.Json" | |
open System.Net | |
open System.Net.Http | |
open Newtonsoft.Json | |
type Airport = { | |
iata: string; | |
country: string; |
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
<h2>Show flight</h2> | |
<ul> | |
<li> | |
<strong>Date:</strong> | |
<%= @flight.date %> | |
</li> | |
<li> |
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
defmodule Flightlog.FlightView do | |
use Flightlog.Web, :view | |
def download(airport) do | |
url = "https://airportapi02560c297e8.azurewebsites.net/api/Airports?code={not_that_important}&iataCode=" <> airport | |
response = HTTPotion.get url | |
{status, fields} = JSON.decode(response.body) | |
fields | |
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
<li> | |
<strong>Plane Type</strong> | |
<%= @flight.plane_type %> | |
</li> |
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
<div class="jumbotron"> | |
<h2>Flight details</h2> | |
<%= if @id=="1" do %> | |
<strong>Date:</strong> 13.03.2017</br> | |
<strong>Flight Number:</strong>SK 753</br> | |
<strong>From:</strong> CPH</br> | |
<strong>To:</strong> GDN</br> | |
<% else %> | |
No information about flight <%= @id %> ;( ! | |
<% 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
<div class="jumbotron"> | |
<h2>List of flights</h2> | |
<table> | |
<tr><th>Date</th><th>Flight Number</th><th>Details</th></tr> | |
<tr><th>13.03.2017</th><th>SK753</th><th><a href="/flights/1">-></a></th></tr> | |
</table> | |
</div> |
NewerOlder