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
// Flight statuses for departing flights | |
const DEPARTING_STATUSES = { | |
SCH: { text: 'Scheduled', mood: 0 }, | |
DEL: { text: 'Delayed', mood: -1 }, | |
WIL: { text: 'Wait in Lounge', mood: 0 }, | |
GTO: { text: 'Gate', mood: 0 }, | |
GCL: { text: 'Gate Open', mood: 1 }, | |
GTD: { text: 'Gate Closed', mood: -1 }, | |
GCH: { text: 'Gate Changed', mood: 0 }, | |
BRD: { text: 'Boarding', mood: 1 }, |
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 Flight { | |
constructor(flight) { | |
this.name = flight.flightName; | |
this.time = flight.scheduleTime.split(':').splice(0, 2).join(':'); | |
this.gate = flight.gate; | |
this.route = flight.route.destinations.join(' - '); | |
} | |
render() { | |
return $(` |
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 FlightTable { | |
constructor(domNode, options) { | |
this.tableNode = $(domNode); | |
this.tableBody = this.tableNode.find('tbody'); | |
this.direction = options.direction; | |
this.page = 0; | |
var now = Date.now(); |
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 FlightTable { | |
constructor(domNode, options) { | |
this.tableNode = $(domNode); | |
this.tableBody = this.tableNode.find('tbody'); | |
this.direction = options.direction; | |
} | |
updateFlight(flightDetails) { | |
var rowElement = $(` |
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
window.B = window.B || {}; | |
window.B.appId = ''; | |
window.B.appKey = ''; |
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 FlightTable { | |
constructor(domNode) { | |
this.tableNode = $(domNode); | |
this.tableBody = this.tableNode.find('tbody'); | |
} | |
updateFlight(flightDetails) { | |
var rowElement = $(` | |
<tr> | |
<td>${flightDetails.flightName}</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
$.ajax({ | |
url: 'https://api.schiphol.nl/public-flights/flights', | |
headers: { | |
'ResourceVersion': 'v3', | |
}, | |
dataType: 'json', | |
data: { | |
app_id: window.B.appId, | |
app_key: window.B.appKey, | |
flightdirection: 'D', |
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
* { | |
color: red; | |
} | |
.vk { | |
color: green !important; | |
} |
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 googleTabs to {} | |
tell application "Google Chrome" | |
repeat with theWindow in every window | |
repeat with theTab in every tab of theWindow | |
tell theTab | |
if title contains "- Google Search" then | |
set googleTabs to googleTabs & {theTab} | |
end if | |
end tell |
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
filename = ARGV.first | |
input_array = File.readlines(filename).map(&:to_i) | |
def merge_sort(array) | |
if array.length <=1 | |
return array, 0 | |
else | |
center = (array.length / 2).floor | |
left, left_inv = merge_sort(array[0..center - 1]) |
NewerOlder