Skip to content

Instantly share code, notes, and snippets.

View jamesgrubb's full-sized avatar

James jamesgrubb

View GitHub Profile
@jamesgrubb
jamesgrubb / gsap-eases.css
Created May 9, 2024 10:36 — forked from jh3y/gsap-eases.css
GreenSock eases with CSS linear()
:root {
--none: linear(0, 1);
--power1-in: linear( 0, 0.0039, 0.0156, 0.0352, 0.0625, 0.0977, 0.1407, 0.1914, 0.2499, 0.3164, 0.3906 62.5%, 0.5625, 0.7656, 1 );
--power1-out: linear( 0, 0.2342, 0.4374, 0.6093 37.49%, 0.6835, 0.7499, 0.8086, 0.8593, 0.9023, 0.9375, 0.9648, 0.9844, 0.9961, 1 );
--power1-in-out: linear( 0, 0.0027, 0.0106 7.29%, 0.0425, 0.0957, 0.1701 29.16%, 0.2477, 0.3401 41.23%, 0.5982 55.18%, 0.7044 61.56%, 0.7987, 0.875 75%, 0.9297, 0.9687, 0.9922, 1 );
--power2-in: linear( 0, 0.0014 11.11%, 0.0071 19.24%, 0.0188 26.6%, 0.037 33.33%, 0.0634 39.87%, 0.0978 46.07%, 0.1407 52.02%, 0.1925 57.74%, 0.2559 63.49%, 0.3295 69.07%, 0.4135 74.5%, 0.5083 79.81%, 0.6141 85%, 0.7312 90.09%, 1 );
--power2-out: linear( 0, 0.2688 9.91%, 0.3859 15%, 0.4917 20.19%, 0.5865 25.5%, 0.6705 30.93%, 0.7441 36.51%, 0.8075 42.26%, 0.8593 47.98%, 0.9022 53.93%, 0.9366 60.13%, 0.963 66.67%, 0.9812 73.4%, 0.9929 80.76%, 0.9986 88.89%, 1 );
--power2-in-out: linear( 0, 0.0036 9.62%, 0.0185 16.66
'use strict';
const fs = require('fs');
const https = require('https');
const puppeteer = require('puppeteer');
/* ============================================================
Promise-Based Download Function
============================================================ */
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 25" width="100%" height="100%">
<text class="title" x="1" y="100%" dx="10"`>Devil</text>
<line x1="1" y1="0" x2="1" y2="100%" stroke-width="0.5"></line>
<line x1="0" y1="100%" x2="100%" y2="100%" stroke="rgba(255,255,255,0.3)" stroke-width="0.5" stroke-dasharray="5,2" stroke-dashoffset="5"></line>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 25" width="100%" height="100%">
<text class="title" x="1" y="100%" dx="0,-1.4,1,0.1,0.4">Devil</text>
<line x1="1" y1="0" x2="1" y2="100%" stroke-width="0.5"></line>
<line x1="0" y1="100%" x2="100%" y2="100%" stroke="rgba(255,255,255,0.3)" stroke-width="0.5" stroke-dasharray="5,2" stroke-dashoffset="5"></line>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 50" width="100%" height="100%">
<text class="title" text-anchor="middle" x="50%" y="50%">Devil</text>
<line x1="0" y1="50%" x2="100" y2="50%" stroke="rgba(255,255,255,0.3)" stroke-width="0.5" stroke-dasharray="5,2" stroke-dashoffset="5"></line>
</svg>
html {
font-size: 16px;
}
@media screen and (min-width: 320px) {
html {
font-size: calc(16px + 6 * ((100vw - 320px) / 680));
}
}
@media screen and (min-width: 1000px) {
html {
font-feature-settings: "tnum";
font-variant-numeric: tabular-nums;
@jamesgrubb
jamesgrubb / wp_insert_post_front_end_form.php
Created June 21, 2018 07:12 — forked from clarklab/wp_insert_post_front_end_form.php
This is a sample front-end form using wp_insert_post(). It's quickly stripped out of my production code from Android and Me, and hasn't been tested alone, so please take it with a grain of salt.
<?
if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['insert_post'] )) { //check that our form was submitted
$title = $_POST['thread_title']; //set our title
if ($_POST['thread_description']=="") { // check if a description was entered
$description = "See thread title..."; // if not, use placeholder
} else {
$description = $_POST['thread_description']; //if so, use it
<meta name="disable-adaptations" content="watch">
<meta name="viewport" content="width=device-width">
@media (min-width : 320px) {
.column {
width: 50%
}
body {
display: flex;
}
@jamesgrubb
jamesgrubb / post.md
Created May 15, 2018 07:13 — forked from levibostian/post.md
webpack, Tachyons, pug, Vue.js web app.

Today, single page web apps are driving many websites that we use each and every day. Instead of having your browser request a new web page for each and every action you perform on a web page, single page web apps may load all in one request to smoothly and quickly transition with every action you perform.

When building single page web apps, you may decide to retrieve all of the HTML, CSS and Javascript with one single page load or dynamically load these resources as the user moves about your site. Either way, it can be a pain to bundle all of these assets together for the end user to download from your web server. This is where webpack comes into play.

webpack does all of the heavy lifting bundling all of your HTML, CSS and Javascript together. If you write your site all from scratch or depend on dependencies from npm, webpack takes care of packaging it all together for you. It has the ability to take your single page web app, cut out all of the code you don't need, then packa