This file contains 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 module = (deps) => { | |
const actuallyPrivate = 'foo' | |
return Object.freeze({ | |
interface | |
}) | |
const interface = () => | |
console.log(deps, actuallyPrivate) | |
} |
This file contains 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 sugar = { | |
on: function(names, fn) { | |
names | |
.split(' ') | |
.forEach(name => | |
this.addEventListener(name, fn)) | |
}, | |
setAttributes: function(attrs) { | |
Object.entries(attrs) | |
.forEach(([key, val]) => |
This file contains 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
:root { | |
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53); | |
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19); | |
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22); | |
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06); | |
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035); | |
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335); | |
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94); | |
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1); | |
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1); |
This file contains 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
history = [ | |
1999: 'VRML' | |
2000: 'HTML' | |
2000: 'CSS' | |
2000: 'JavaScript' | |
2000: 'XML' | |
2005: 'ActionScript2' | |
2007: 'Java' | |
2007: 'PHP' | |
2007: 'MySQL' |
This file contains 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
// this really what it takes to increment a counter on an item in my observable | |
// likes is a subject, broadcasting the updated array eventually to the source observable being rendered | |
this.likes | |
.map( | |
(message: Message): IMessagesOperation => | |
(messages: Message[]) => { | |
return messages.map((m: Message) => { | |
// todo: check if user has already liked | |
if (m.id == message.id) | |
++m.likes |
This file contains 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 el = function(options) { | |
let node = document.createElement(options.type || 'div') | |
if (options.id) node.id = options.id | |
if (options.class) node.className = options.class | |
if (options.text) node.textContent = options.text | |
if (options.html) node.innerHTML = options.html | |
return node | |
} |
This file contains 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
var els = document.querySelectorAll('.vh-fix') | |
if (!els.length) return | |
for (var i = 0; i < els.length; i++) { | |
var el = els[i] | |
if (el.nodeName === 'IMG') { | |
el.onload = function() { | |
this.style.height = this.clientHeight + 'px' | |
} | |
} else { |
This file contains 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
app.notify = (function() { | |
// Determine the correct object to use | |
var notification = window.Notification || window.mozNotification || window.webkitNotification || false | |
, permission = false | |
, note; | |
function init() { | |
notification && notification.requestPermission(permissionSuccess); | |
} |
This file contains 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
# save to /etc/nginx/conf.d/gzip.conf | |
gzip on; | |
gzip_proxied any; | |
gzip_types text/plain text/xml text/css application/x-javascript; | |
gzip_vary on; | |
gzip_disable "MSIE [1-6]\.(?!.*SV1)"; |
This file contains 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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-icons/core-icons.html"> | |
<link rel="import" href="../paper-item/paper-item.html"> | |
<link rel="import" href="../paper-slider/paper-slider.html"> | |
<link rel="import" href="../paper-toggle-button/paper-toggle-button.html"> |