Skip to content

Instantly share code, notes, and snippets.

Paul Lewis paullewis

Block or report user

Report or block paullewis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@paullewis
paullewis / TypeScript+RxJS+Closure.md
Last active Apr 29, 2018
TypeScript + RxJS + Closure Compiler setup
View TypeScript+RxJS+Closure.md

I'm just going to make a note of this for Future Paul, because I spent way too long trying to get this working. If anyone has a better version of this workflow let me know.

Here's the rough idea:

  1. Have some TypeScript
  2. With some RxJS. Only include the bits of RxJS that we actually need because bundle sizes.
  3. Combine to a bundle using Closure Compiler (because it's super good at crushing down JS).

Because Future Paul will want it, here's the installs needed:

@paullewis
paullewis / html
Last active Mar 6, 2017
Animation easing
View html
<!DOCTYPE html>
<!--
Copyright 2017 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@paullewis
paullewis / requestIdleCallback.js
Last active Sep 20, 2019
Shims rIC in case a browser doesn't support it.
View requestIdleCallback.js
/*!
* Copyright 2015 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@paullewis
paullewis / SassMeister-input-HTML.html
Last active Aug 29, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<nav>
<ul class="site-nav">
<li class="site-nav__item site-nav__item--first">The Workshop</li>
<li class="site-nav__item">2013 Schedule</li>
<li class="site-nav__item">About CSSWizardry</li>
<li class="site-nav__item site-nav__item--last">Contact</li>
</ul>
</nav>
@paullewis
paullewis / drag.html
Last active Jul 16, 2017
Stick and Ease
View drag.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="style.css">
<title>Draggable</title>
</head>
View index.md
@paullewis
paullewis / a-model-driven-api-and-offline-approach.md
Last active Dec 11, 2015
A description of model-driven APIs and transparent offline mechanisms
View a-model-driven-api-and-offline-approach.md

The broad idea

We have an HTML-based web app that allows you to visually create your app’s data model. It would allow you to create your various objects with their member properties, as well as defining the relationship of properties to other objects, similar to key constraints in database designs.

Crucially, with a model defined we can scaffold out:

  • Server-side API endpoints
  • Server-side storage
  • Client-side models and APIs
  • Client-side offline storage
@paullewis
paullewis / gist:2666342
Created May 12, 2012
Mozhack - Particle Demo
View gist:2666342
/**
* Requires Three.js r49
*/
var AEROTWIST = {};
AEROTWIST.Experiment = (function() {
var scene = null,
camera = null,
renderer = null,
time = 0,
View carousel.js
@paullewis
paullewis / gist:1982121
Created Mar 5, 2012
Mergesort in JavaScript
View gist:1982121
/**
* An implementation for Mergesort. Less efficient
* than Quicksort. Again, you'd just use Array.sort
* but if you found yourself unable to use that
* there's always this option.
*
* Tests with:
*
* var array = [];
* for(var i = 0; i < 20; i++) {
You can’t perform that action at this time.