Skip to content

Instantly share code, notes, and snippets.

View uglow's full-sized avatar
🟪
DigIO

Brett Uglow uglow

🟪
DigIO
View GitHub Profile
@uglow
uglow / Demo1A.js
Last active August 29, 2015 14:02
AngularJS Melbourne - Companion Demo Files
//---------- sitemap.jsonp ----------//
mwApp.SITEMAP=[
{
"title": "Section Title",
"children": [
{
"title": "Page title",
"children": [
{
@uglow
uglow / angularjs_directive_attribute_explanation.md
Created November 25, 2015 00:55 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
import angular from 'angular';
import ToDoComponent from './todo.component';
import FormComponent from './form.component';
export default angular
.module('main.app.feature-b', [])
.component('todo', ToDoComponent)
.component('todo', FormComponent)
.name;
import angular from 'angular';
import myServiceMod from './myService';
const mod = angular.module('company.module.component', [myServiceMod]);
// The wiring of the component is INSIDE this file.
// The dependencies are explicit (yet still injectable)
// The component can be re-used easily!
mod.component('myComponent', {
bindings: {...},
import moduleUnderTest from './myComponent.js';
describe('myComponent', () => {
let component;
beforeEach(() => {
angular.mock.module(moduleUnderTest);
angular.mock.inject((myComponent) => {
component = myComponent;
export default class MyComponent {
constructor($http, $timeout, $location) { ... }
lookupAddress() {
$http(...).then(() => {
$location.url('somewhere');
});
}
}
importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();
const cacheFirstStrategy = workbox.strategies.cacheFirst();
const networkFirstStrategy = workbox.strategies.networkFirst({networkTimeoutSeconds: 10});
// Go to the network first for APIs, then to the cache
workbox.router.registerRoute('http*://*/api/*', networkFirstStrategy, 'GET');
// Cache the external fonts
@uglow
uglow / hiring.md
Last active November 10, 2021 00:36
Hiring process for software engineers working with web technology

Web & API Hiring process

This document outlines the process for hiring a software engineer who will be working on developing user interfaces for the web-platform and/or developing APIs.

General approach

  1. Introduce ourselves and set expectations that tech interview will take 30 - 90 mins with the aim to find out where candidate is strong and where they are weak (3 min)
  2. Introduce company - what we do, clients, working environment, practices (3 min)
  3. Ask what they are passionate about, things they are proud of in their career so far, how do they learn new things, presentations they've made, blog articles (etc) (6 min)
@uglow
uglow / drawio-svg.js
Last active August 31, 2018 05:59
DrawIO SVG Filter Button script
//<![CDATA[
// This script is designed to be imported by an SVG file created by DrawIO.
// While we wait for DrawIO to export layers and groups correctly for SVGs,
// this is a hacky way to add filter buttons to filter shapes based on their stroke or fill.
//
// It basically works by looking for nodes with the background colour #abcdef. These nodes represent toggle buttons.
//
// Need to request this gist via rawgit.com (see https://stackoverflow.com/questions/17341122/link-and-execute-external-javascript-file-hosted-on-github)
@uglow
uglow / interactive-drawio.svg
Last active August 31, 2018 06:45
Example of using script within SVG. Based on info from http://www.petercollingridge.co.uk/tutorials/svg/interactive/javascript/ and my own DrawIO SVG hacking (as DrawIO's SVG support is barely functional). Working version:https://rawgit.com/uglow/60ea0ec165ac4426e40c9174569cabcf/raw/3e880520260f56e73ec3bf5ab9f0399b6dfa4541/interactive-drawio.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.