Skip to content

Instantly share code, notes, and snippets.

View itwasmattgregg's full-sized avatar
:octocat:
Artisinally crafting interwebs

Matt Gregg itwasmattgregg

:octocat:
Artisinally crafting interwebs
View GitHub Profile
import { PostPartialUpdateRequest, PostUpdateRequest, ExternalLink, Post } from "../gen/api";
import { Component } from "react";
import { apiCall, postApi, externalLinkApi } from "../Api";
export type PostCreateUpdateRequest = Post;
function isPostUpdateRequest(request: PostCreateUpdateRequest): request is PostPartialUpdateRequest | PostUpdateRequest {
return (request as PostPartialUpdateRequest).id !== undefined;
}
@itwasmattgregg
itwasmattgregg / main.js
Created October 17, 2019 21:26
WP Vue Main
import "@babel/polyfill";
import Vue from "vue";
import * as VueGoogleMaps from "vue2-google-maps";
import VTooltip from "v-tooltip";
import router from "@/router";
import store from "@/store";
import Search from "@/Search.vue";
@itwasmattgregg
itwasmattgregg / index.js
Created June 28, 2018 15:32 — forked from codediodeio/index.js
Firebase Cloud Functions image thumbnail generator using Sharp for 4x faster resizing
const functions = require('firebase-functions');
const gcs = require('@google-cloud/storage')();
const sharp = require('sharp')
const _ = require('lodash');
const path = require('path');
const os = require('os');
exports.generateThumbnail = functions.storage.object('uploads/{imageId}').onChange(event => {
const object = event.data; // The Storage object.
@itwasmattgregg
itwasmattgregg / Top arrow with inner shadow.css
Last active September 23, 2016 21:15
Generated by SassMeister.com.
section {
padding: 40px 0px;
background-color: #fff;
width: 100%;
}
.border-top {
background-color: #eee;
position: relative;
box-shadow: 0 2px 4px #ccc inset;
@itwasmattgregg
itwasmattgregg / Blend Mode Loading Spinner.html
Last active September 14, 2016 16:35
Generated by SassMeister.com.
<div class="loading">
<span class="bar bar-1"></span>
<span class="bar bar-2"></span>
<span class="bar bar-3"></span>
<span class="bar bar-4"></span>
</div>
@itwasmattgregg
itwasmattgregg / Image white border on hover.html
Last active August 30, 2016 16:34
Generated by SassMeister.com.
<div class="image">
<img src="https://www.yatzer.com/sites/default/files/media/slideshow/f5_out_my_window_gail_albert_halaban_new_york_glasshousewithdog_yatzer.jpg" />
<div class="caption">
A nice caption for out image
<br>
<button class="btn">Action Item</button>
</div>
</div>
@itwasmattgregg
itwasmattgregg / Checkbox with cool check.html
Last active August 30, 2016 16:35
Generated by SassMeister.com.
<div class="checkbox">
<input id="check1" type="checkbox">
<label for="check1"><span>Test</span></label>
</div>
@itwasmattgregg
itwasmattgregg / SassMeister-input-HTML.html
Created May 31, 2016 15:03
Generated by SassMeister.com.
<div class="background">
<div class="bounds">
<div class="element">
<span class="inner-text">30</span>
<span class="option" value="1"></span>
<span class="option" value="2"></span>
<span class="option active" value="3"></span>
<span class="option" value="4"></span>
<span class="option" value="5"></span>
<span class="option" value="6"></span>
@itwasmattgregg
itwasmattgregg / schedule.html
Last active August 30, 2016 16:36
Show's current time position on a vertical schedule. Open in jsbin etc.
<div class="clock">
<div class="current-time">
</div>
8:00am
<div class="block" data-time="8">
<div class="class">
</div>
<div class="class">
@itwasmattgregg
itwasmattgregg / checkbox.html
Last active May 5, 2016 16:23
Checkbox with one pseudo element with only css
<div class="checkbox">
<label>
<input type="checkbox"> Checkbox
</label>
</div>