This file contains hidden or 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
| curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh -o ~/.config/git-completion.zsh | |
| mkdir -p ~/.zsh/functions && cp git-completion.zsh ~/.zsh/functions/_git |
This file contains hidden or 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
| // an example to create a new mapping `ctrl-y` | |
| // mapkey('<Ctrl-y>', 'Show me the money', function() { | |
| // Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).'); | |
| // }); | |
| unmap('R'); | |
| unmap('E'); | |
| unmap('<Ctrl-i>'); | |
| unmap("<Ctrl-'>"); | |
| unmap('cp'); |
This file contains hidden or 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
| # First, we need to find our device. BEFORE inserting your USB drive, run the | |
| # following: | |
| diskutil list | |
| # This will output a bunch of info about all of the disk drives connected to | |
| # your Mac. Each entry will have a header in the form "/dev/diskX", where X is | |
| # some number starting at 0. Now, insert your USB drive and run the command | |
| # again. You should see a new entry. Make note of the name (ie, /dev/diskX). | |
| diskutil list |
This file contains hidden or 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 makeStack() { | |
| let head = null | |
| function push(item) { | |
| if (head == null) head = { value: item } | |
| else head = { value: item, next: head } | |
| } | |
| function isEmpty() { | |
| return head == null | |
| } | |
| function peek() { |
This file contains hidden or 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. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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> |
NewerOlder