Skip to content

Instantly share code, notes, and snippets.

View matthewmorek's full-sized avatar
🙈
Breaking builds

Matthew Morek matthewmorek

🙈
Breaking builds
View GitHub Profile
@matthewmorek
matthewmorek / StoryblokPicture.vue
Last active June 9, 2020 12:12
Vue Storyblok Picture Component
<template>
<picture>
<source
v-for="format in formats"
:srcset="srcset(url, sizes, format, quality)"
:alt="alt"
:key="format"
:type="`image/${format}`"
/>
<img :src="src(url, 960, 'jpg', 90)" :alt="alt" />
@matthewmorek
matthewmorek / build-deploy.sh
Created April 18, 2020 13:19
Build and deploy with Parcel to Netlify with preview URLs
#!/bin/sh
set -e
echo "== BUILDING =="
if [ "$CONTEXT" = "production" ]; then
parcel build public/**/*.html --public-url ${URL} --no-source-maps
else
parcel build public/**/*.html --public-url ${DEPLOY_URL} --no-source-maps
fi
@matthewmorek
matthewmorek / App.vue
Last active August 6, 2019 15:02
PWA Service Worker
<template>
<div id="app">
<h1>My app</h1>
</div>
</template>
<script>
export default {
name: 'My app',
mounted() {
@matthewmorek
matthewmorek / polyfils.js
Last active March 6, 2018 12:50
Handy JavaScript polyfils
/**
* Barebones OS detection
* @return {OSName} string - contains OS alias
*/
var platform = function () {
'use strict';
var OSName="generic";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="win";
if (navigator.appVersion.indexOf("Mac")!=-1) OSName="mac";

Keybase proof

I hereby claim:

  • I am matthewmorek on github.
  • I am matthewmorek (https://keybase.io/matthewmorek) on keybase.
  • I have a public key ASDHS_N-MBkWAvG1pBDqCfcWGas5VmaEEcbdNJ9IWW7LzQo

To claim this, I am signing this object:

@matthewmorek
matthewmorek / sync.sh
Created October 24, 2015 12:55
CS-Cart 4.3.x Sync Script
#!/bin/sh
# ---
# This script assumes you're using SSH key-based authentication to your remote
# It should be run from the root of the local CS-Cart installation, i.e.: `$ ./bin/sync.sh`
# ---
red='\033[0;31m'
green='\033[0;32m'
normal='\033[0m'