Skip to content

Instantly share code, notes, and snippets.

My reply to https://helloanselm.com/2016/open-service-worker-questions/, which sets a new record for false statements per word.

The first thing I noticed after making sure that Service Worker are enabled (Chrome is behind flags)

No they're not. They've been in stable for over a year now.

was that I found no user setting or any hint in the developer tools about service workers

There's a service worker panel in the sources tab and in the resources tab. There's also chrome://serviceworker-internals/. The script also appears in the context dropdown (as iframes do). The script itself also appears in the sources panel. You can also type navigator.serviceWorker.controller into the console to inspect the controlling service worker for the page.

@nathanwoulfe
nathanwoulfe / nunpublish.js
Created June 5, 2018 10:19
Hide the unpublish button for members of the editor group
/* package.manifest...
*
* {
* "javascript" : ["~/App_Plugins/nunpublish/script.js"]
* }
*/
(function () {
function directive(authResource) {
@adewale
adewale / gist:6e2baa8fdea65108b257fe9fbdae3b77
Created August 23, 2016 15:10
Common misconceptions about Progressive Web Apps
Common misconceptions about Progressive Web Apps
They have to be SPAs.
They have to live at pwa.*.com
They have to be mobile only.
They're not allowed to be responsive.
They have to use material design.
They only work in chrome.
They don't work in safari or on iOS.
They have to look like your android app.
@johan
johan / google-map-marker-with-shadow.js
Created May 21, 2012 17:02 — forked from simonw/google-map-marker-with-shadow.js
google-map-marker-with-shadow.js
/* Here's how to add a coloured marker to a Google Map with a shadow in the
right place.
The pin itself used to be dynamically generated via Google Charts:
//chart.apis.google.com/chart?chst=d_map_pin_letter&chld=|3491FF|000000
documented here:
https://developers.google.com/chart/image/docs/gallery/dynamic_icons
Note however that this API was marked as deprecated on April 20th 2012
although it's not clear when or if it will be turned off.
@madsrasmussen
madsrasmussen / umbraco.api.js
Created May 28, 2018 11:16
Slave and Eagle - Umbraco Headless JS Client
import axios from 'axios'
import _ from 'lodash'
const baseUrl = 'https://slave-eagle.s1.umbraco.io/'
const restUrl = 'umbraco/rest/v1/content/published/'
class Umbraco {
constructor () {
this.baseUrl = baseUrl
}
@cssquirrel
cssquirrel / FileUploadApiController.cs
Last active January 25, 2019 11:49
Using AngularJS API service and Umbraco API controller to permit users to upload files to the server
// Use whatever namespacing works for your project.
namespace YourSite.Web.Controllers.Api
{
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
@zersiax
zersiax / umbraco 8 accessibility notes.md
Last active September 20, 2019 06:26
A series of stream-of-consciousness-style noites while going through the Umbraco8 basic tutorial

Umbraco 8 Basic Website Tutorial: Accessibility/UX notes

Intro

This is a stream of consciousness-style list of notes I put down while trying to go through the Umbraco 8 Basic Site tutorial. Accessibility hurdles will be noted, nitpicky as they may be. This test is run using the dev/v8 branch on the 18th of September 2019.

Installer

  • In the first screen, the button to customize the installation is a link ( tag). This is confusing as links and buttons do different things and a user hopping from button to button will outright miss this control.
  • On the page to select if you want a starter kit or not, the link to accept the starter kit has the link text of "Loading".
  • On the installer progress page, the heading structure is broken; the progress is denoted by a heading 3, with a "Did you know?" heading level 2 above it. There's two things wrong with this, namely:
1. Highlight a recommended option,

2. Allow users to switch currency (€/$/£)

3. Allow users to switch pricing monthly/yearly

4. Keep the entire pricing plan area clickable

5. Use slider to calculate how much a user would save

6. Provide free first month for good engagement

7. Prominently highlight testimonials prominently

8. Repeating call to action on top and bottom

9. Sell benefits instead of features

10. Indicate that users can cancel any time

@jonathantneal
jonathantneal / README.md
Last active November 5, 2023 05:42
Practical ARIA Tabs: Creating fully accessible tabs

Practical ARIA Tabs

This is a small guide to marking up fully accessible tabs. Consider using PostHTML ARIA Tabs as a practical solution.

The Rules

  1. Add tablist role to the <ul> to indicate it contains tabs.
  2. Add presentation role to each <li> to bypass its list item state.
  3. Add tab role to each <a> to incidate it is an actual tab.
  4. Add href and aria-controls to each <a> to reference its tab panel.
@leekelleher
leekelleher / cmsContentType_Usage.sql
Last active January 19, 2024 19:03
Umbraco - database analysis - SQL Queries
-- Copied from Hendy https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/72814-creating-a-list-of-unused-doc-types#comment-233729
-- Find all unused docTypes
-- These results may contain docTypes that are masters of used ones, so need to exclude these too...
SELECT
A.nodeId as 'DocTypeId',
B.text AS 'Name',
A.alias AS 'Alias'
FROM
cmsContentType A LEFT JOIN