Skip to content

Instantly share code, notes, and snippets.

@caraya
caraya / sw.js
Last active February 27, 2018 21:02
service worker to cache fonts
importScripts(
'https://storage.googleapis.com/workbox-cdn/releases/3.0.0-beta.0/workbox-sw.js '
);
if (workbox) {
workbox.routing.registerRoute(
/.*\.(?:woff2,woff,ttf,otf)/,
workbox.strategies.cacheFirst({
cacheName: 'font-cache',
plugins: [

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Globalize App example using Webpack</title>
</head>
<body>
<h1>Globalize App example using Webpack</h1>
@caraya
caraya / drive-appscript.js
Created October 16, 2017 20:03 — forked from igrigorik/drive-appscript.js
Sample BigQuery queries for the HTTP Archive dataset.
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [ {name: "Run Query", functionName: "runQuery"} ];
ss.addMenu("HTTP Archive + BigQuery", menuEntries);
}
function runQuery() {
var projectNumber = 'httparchive';
var sheet = SpreadsheetApp.getActiveSheet();
@caraya
caraya / sw.js
Created September 16, 2017 20:28
/* eslint-disable no-undef */
const PRECACHE = 'precache-v1';
const RUNTIME = 'runtime-v1';
const IMAGES = 'images-v1';
const PRECACHE_URLS = [
'./', // Alias for index.html
'styles/main.css',
'scripts/main.js',
'/offline.html'
@caraya
caraya / css-data.json
Last active July 12, 2017 23:33
Trying to figure out why this is not working
{
"name": "CSS",
"children": [
{
"name": "Alignment",
"children": [
{
"size": 1000,
"name": "align-content",
"url": "http://docs.webplatform.org/wiki/css/properties/align-content"
When I write the following fenced codeblock like this:
```jvascript
// code goes here
```
Jetpack produces the following HTML
<pre><code class="javascript">
// code goes here
@caraya
caraya / fancy-tabs-demo.html
Created October 25, 2016 12:51 — forked from ebidel/fancy-tabs-demo.html
Fancy tabs web component - shadow dom v1, custom elements v1, full a11y
<script>
function execPolyfill() {
(function(){
// CustomElementsV1.min.js v1 polyfill from https://github.com/webcomponents/webcomponentsjs/tree/v1/src/CustomElements/v1.
/*
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install caskroom/cask/brew-cask
brew cask install google-chrome
ln -sf ~/Applications/Google\ Chrome.app /Applications
brew cask install megasync
ln -s '/opt/homebrew-cask/Caskroom/megasync/latest/MEGAsync.app' '/Applications/MEGAsync.app'
brew cask install dropbox
brew cask install google-drive
brew cask install iterm2
brew cask install spectacle
@caraya
caraya / gulpfile.babel.js
Created August 3, 2016 04:09 — forked from timothyis/gulpfile.babel.js
Gulp 4, ES6 gulpfile example
// Gulp module imports
import {src, dest, watch, parallel, series} from 'gulp';
import del from 'del';
import livereload from 'gulp-livereload';
import sass from 'gulp-sass';
import minifycss from 'gulp-minify-css';
import jade from 'gulp-jade';
import gulpif from 'gulp-if';
import babel from 'gulp-babel';
import yargs from 'yargs';