Skip to content

Instantly share code, notes, and snippets.

@mfrancois3k
mfrancois3k / Responsive moble css
Created May 9, 2023 02:03
Responsive moble css Freemote #CSS #moble
fremoote coming soon
https://codepen.io/freemote/pen/MWoQapE?editors=1100
@font-face {
font-family: 'AdiHaus';
src: URL('https://assets.codepen.io/6060109/adihaus_regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
@mfrancois3k
mfrancois3k / Gsap Simple loading page wipe
Created April 27, 2023 05:07
Gsap Simple loading page wipe #effects #gsap #JavaScript
<body>
<!-- animation -->
<div class="animation">
<h1 class="animate">loading<span>loading</span>loading<span>loading</span></h1>
<h1 class="animate">loading<span>loading</span>loading<span>loading</span></h1>
<h1 class="animate">loading<span>loading</span>loading<span>loading</span></h1>
<h1 class="animate">loading<span>loading</span>loading<span>loading</span></h1>
<h1 class="animate">loading<span>loading</span>loading<span>loading</span></h1>
<h1 class="animate">loading<span>loading</span>loading<span>loading</span></h1>
</div>
@mfrancois3k
mfrancois3k / openai_api_config.js
Created April 19, 2023 05:09 — forked from eniodev/openai_api_config.js
This is a starter snippet for building applications powered by openAI models
// npm i openai dotenv
import { config } from 'dotenv';
config();
// OpenAI API Configuration
import { Configuration, OpenAIApi } from "openai";
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY, // Replace this with your key
@mfrancois3k
mfrancois3k / autofill-feedback-email.js
Created April 19, 2023 04:59 — forked from kentcdodds/autofill-feedback-email.js
I use this to automatically fill in email addresses in feedback forms throughout workshop material
#!/usr/bin/env node
const path = require('path')
const inquirer = require('inquirer')
const replace = require('replace-in-file')
const isCI = require('is-ci')
const spawn = require('cross-spawn')
const fileGlob = process.argv[2] || 'src/**/*.*'
const files = path.isAbsolute(fileGlob)
@mfrancois3k
mfrancois3k / ConvertKit index.js
Created April 19, 2023 04:56 — forked from kentcdodds/index.js
ConvertKit Sync ConvertKit with TestingJavaScript.com
const fs = require('fs/promises')
const fetch = require('make-fetch-happen').defaults({
cacheManager: './node_modules/.cache/make-fetch-happen',
})
const csv = require('csvtojson')
const {CONVERT_KIT_API_KEY, CONVERT_KIT_API_SECRET} = process.env
const levels = ['standard-testing', 'basic-testing', 'pro-testing']
@mfrancois3k
mfrancois3k / cache cachified.ts
Created April 19, 2023 04:54 — forked from kentcdodds/cachified.ts
cache Turn any function into a cachified one. With forceFresh support and value checking (for when the data type changes). This uses redis, but you could change it to use whatever you want.
type CacheMetadata = {
createdTime: number
maxAge: number | null
expires: number | null
}
function shouldRefresh(metadata: CacheMetadata) {
if (metadata.maxAge) {
return Date.now() > metadata.createdTime + metadata.maxAge
}
@mfrancois3k
mfrancois3k / ConvertKit tag.js
Created April 19, 2023 04:52 — forked from kentcdodds/tag.js
ConvertKit Tag subscribers of a ConvertKit sequence with a tag
const fetch = require('make-fetch-happen').defaults({
cacheManager: './node_modules/.cache/make-fetch-happen',
})
// add a .env file that has this in it:
// CONVERT_KIT_API_KEY=some_api_key
// CONVERT_KIT_API_SECRET=some_api_secret
require('dotenv').config()
const {CONVERT_KIT_API_KEY, CONVERT_KIT_API_SECRET} = process.env
@mfrancois3k
mfrancois3k / caching code jokes.md
Created April 19, 2023 04:50 — forked from kentcdodds/jokes.md
Headers and caching section removed from the Remix Tutorial because it was too long.

Headers and Caching

Caching is a big subject and it can get pretty complicated. Luckily, the browsers have done all the really hard work for us and we just need to #useThePlatform.

There are three types of caches you'll likely deal with in Remix applications:

  1. Application-level caches that you implement in your own code.
  2. Browser caches you can control through the Cache-Control header.
  3. CDN caches you also can control through the Cache-Control headers.

Form component with first name and email address fields to subscribe to a form, tag, or sequence in ConvertKit.

Requirements

  1. API endpoint under /api/convertkit/subscribe which can be imported from @skillrecordings/convertkit/dist/api/subscribe
  2. Environment variables:
NEXT_PUBLIC_CONVERTKIT_SIGNUP_FORM=convertkit_form_id
NEXT_PUBLIC_CONVERTKIT_TOKEN=convertkit_public_token
NEXT_PUBLIC_CONVERTKIT_SUBSCRIBER_KEY=ck_subscriber_id
@mfrancois3k
mfrancois3k / convertkit-cache-tags
Created April 19, 2023 04:28 — forked from thomas-mcgee/convertkit-cache-tags
Cache ConvertKit Tag List
function build_convertkit_tag_list( $force_refresh = 0 ) {
$convertkit_api_key = ( isset( $_POST['nt_convertkit_api'] ) ? $_POST['nt_convertkit_api'] : null );
if ( !empty( $convertkit_api_key ) || $force_refresh ) :
$api_key = get_option( 'nt_convertkit_api' );
if ( !empty( $api_key ) ) {