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
// Add any other logic here as needed. | |
import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin'; | |
import { CacheFirst } from 'workbox-strategies/CacheFirst'; | |
import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL'; | |
import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin'; | |
import { NavigationRoute } from 'workbox-routing/NavigationRoute'; | |
import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute'; | |
import { registerRoute } from 'workbox-routing/registerRoute'; |
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
# http://www.w3.org/TR/AERT#color-contrast | |
getBrightness = (rgb) -> | |
sum = parseInt(rgb[0])*299 + parseInt(rgb[1])*587 + parseInt(rgb[2])*114 | |
brightness = Math.round(sum / 1000) # 0 (dark) to 255 (light) | |
colorDifference = (a, b) -> | |
max = Math.max | |
min = Math.min | |
d0 = max(a[0], b[0]) - min(a[0], b[0]) |
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
<?php | |
return [ | |
'GB' => '/^GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}$/', | |
'JE' => '/^JE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/', | |
'GG' => '/^GY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/', | |
'IM' => '/^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/', | |
'US' => '/^\d{5}([ \-]\d{4})?$/', | |
'CA' => '/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ ]?\d[ABCEGHJ-NPRSTV-Z]\d$/', | |
'DE' => '/^\d{5}$/', |
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
sudo update-alternatives --set php /usr/bin/php7.2 | |
sudo update-alternatives --set phar /usr/bin/phar7.2 | |
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.2 | |
sudo update-alternatives --set phpize /usr/bin/phpize7.2 | |
sudo update-alternatives --set php-config /usr/bin/php-config7.2 | |
sudo update-alternatives --set php /usr/bin/php5.6 | |
sudo update-alternatives --set phar /usr/bin/phar5.6 | |
sudo update-alternatives --set phar.phar /usr/bin/phar.phar5.6 | |
sudo update-alternatives --set phpize /usr/bin/phpize5.6 |
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
{ | |
"name": "webpack-quickstart", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"dev": "webpack --mode development", | |
"build": "webpack --mode production", | |
"start": "webpack-dev-server --mode development --open" | |
}, |
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
class Router extends Backbone.Router { | |
contructor(options){ | |
} | |
get routes() { | |
return { | |
':section': 'showSection', | |
'*action': 'default', | |
}; | |
} |
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 {Model} from 'backbone'; | |
class TodoModel extends Model { | |
constructor(options) { | |
super(options); | |
this.urlRoot = '/todo'; | |
} |
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 {Collection} from 'backbone'; | |
import TodoModel from 'models/todos/todo'; | |
class TodosCollection extends Collection { | |
constructor(options) { | |
super(options); | |
this.model = TodoModel; | |
this.page = 1; | |
this.numResults = 10; |
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 Mustache from 'mustache'; | |
import {View} from 'backbone'; | |
import TodoItemView from 'views/todos/todo_item'; | |
import TodosCollection from 'collections/todos/todos'; | |
import TodoModel from 'models/todos/todo'; | |
import template from 'templates/todos/todos.html!text'; | |
class TodoListView extends View { | |
constructor(options) { |
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
<?php | |
// This can be found in the Symfony\Component\HttpFoundation\Response class | |
const HTTP_CONTINUE = 100; | |
const HTTP_SWITCHING_PROTOCOLS = 101; | |
const HTTP_PROCESSING = 102; // RFC2518 | |
const HTTP_OK = 200; | |
const HTTP_CREATED = 201; | |
const HTTP_ACCEPTED = 202; |