Skip to content

Instantly share code, notes, and snippets.

View vtambourine's full-sized avatar
🦉

Benjamin T vtambourine

🦉
View GitHub Profile
// 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 },
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 $(`
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();
class FlightTable {
constructor(domNode, options) {
this.tableNode = $(domNode);
this.tableBody = this.tableNode.find('tbody');
this.direction = options.direction;
}
updateFlight(flightDetails) {
var rowElement = $(`
window.B = window.B || {};
window.B.appId = '';
window.B.appKey = '';
class FlightTable {
constructor(domNode) {
this.tableNode = $(domNode);
this.tableBody = this.tableNode.find('tbody');
}
updateFlight(flightDetails) {
var rowElement = $(`
<tr>
<td>${flightDetails.flightName}</td>
$.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',
@vtambourine
vtambourine / safari.css
Last active August 4, 2016 20:22
safari.css
* {
color: red;
}
.vk {
color: green !important;
}
@vtambourine
vtambourine / close-google-search-tabs.as
Last active July 15, 2016 14:39
Close all Google Search tabs in all Chrome windows
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
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])