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
import * as angular from "angular"; | |
class WhilePressedController { | |
private intervalPromise: Function; | |
private intervalTime: number; | |
static $inject = ['$scope', '$element', '$interval']; | |
constructor(private scope, private element, private interval) { |
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
export const scriptLoader = { | |
load: (src) => { | |
return new Promise((resolve, reject) => { | |
if (document.querySelector("script[src=\"" + src + "\"]")) { | |
resolve(); | |
return; | |
} | |
const el = document.createElement("script"); |
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
export function smoothScrollingTo(target) { | |
$('html,body').animate({ scrollTop:$(target).offset().top }, 500); | |
} | |
/** smooth scroll on anchor */ | |
/* | |
$('a[href*=\\#]').on('click', function(event){ | |
event.preventDefault(); | |
smoothScrollingTo(this.hash); | |
}); |
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
{ | |
"hosting": { | |
"public": "dist", | |
"rewrites": [ | |
{ "source": "/events/*", "function": "eventsReqHandler" }, | |
{ "source": "**", "destination": "/index.html" } | |
] | |
} | |
} |
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
import * as functions from 'firebase-functions'; | |
import * as express from 'express'; | |
const app = express(); | |
app.get('/events/:id', (request, response) => { | |
const userAgent = request.get('user-agent'); | |
if (userAgent.indexOf("facebookexternalhit") === 0) { | |
res.status(200).send(` | |
<!doctype html> |
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
import * as functions from 'firebase-functions'; | |
import * as express from 'express'; | |
const app = express(); | |
function buildOgTemplate(event: any) { | |
return ` | |
<!DOCTYPE html> | |
<html> | |
<head> |
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
function removeByKey (myObj, deleteKey) { | |
return Object.keys(myObj) | |
.filter(key => key !== deleteKey) | |
.reduce((result, current) => { | |
result[current] = myObj[current]; | |
return result; | |
}, {}); | |
} |
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
"use strict"; | |
// machine state definitions | |
var States; | |
(function (States) { | |
States["idle"] = "idle"; | |
States["userLogged"] = "userLogged"; | |
States["userUnlogged"] = "userUnlogged"; | |
States["startTimePending"] = "startTimePending"; | |
States["startTimeReady"] = "startTimeReady"; | |
})(States || (States = {})); |
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
const States = { | |
play: 'play', | |
error: 'error', | |
idle: 'idle' | |
} | |
const Transitions = { | |
loginSuccessful: 'loginSuccessful', | |
didDisplaySharer: 'didDisplaySharer', | |
cancelPlayRequest: |
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
/** | |
* describes the outcome of the machine reducer | |
* fn. | |
* The Invalid variant value describes the case | |
* where an undesired event is received | |
* (cannot receive the event while being in | |
* current state). | |
* The Ignored variant value describes the case | |
* where we just want to not take action after | |
* receiving a specific event. |
OlderNewer