Skip to content

Instantly share code, notes, and snippets.

View marcusstenbeck's full-sized avatar
🤙
Crushing it.

Marcus Stenbeck marcusstenbeck

🤙
Crushing it.
View GitHub Profile
@marcusstenbeck
marcusstenbeck / GoogleFontText.tsx
Created November 10, 2022 09:11
Remotion 3.2.40 - Dynamic font loading
import React, { useEffect, useState } from 'react';
import {
AbsoluteFill,
continueRender,
delayRender
} from 'remotion';
import { getAvailableFonts } from '@remotion/google-fonts';
const availableFonts: {
fontFamily: string;
@marcusstenbeck
marcusstenbeck / MyVideo.tsx
Created October 13, 2022 11:29
Remotion custom font loading
import React, { useEffect, useState } from 'react';
import {
continueRender,
delayRender,
useCurrentFrame,
useVideoConfig,
} from 'remotion';
import { css } from './utils/cssTag';
function logLoadedFonts() {
@marcusstenbeck
marcusstenbeck / ExampleComponent.tsx
Last active November 21, 2022 20:33
Remotion + Popmotion
import * as popmotion from 'popmotion';
import { pop } from './RemotionPop';
const easeOutQuint = popmotion.cubicBezier(0.22, 1, 0.36, 1);
const ExampleComponent = () => {
// you can animate any normal HTML element, ex. `pop.h2` or `pop.span`
return (
<pop.div
@marcusstenbeck
marcusstenbeck / Form.js
Last active October 11, 2018 17:07
React Form handler using render props
import React from 'react';
import T from 'prop-types';
class Form extends React.Component {
static propTypes = {
onSubmit: T.func.isRequired,
children: T.func.isRequired,
};
constructor(props, ...rest) {
@marcusstenbeck
marcusstenbeck / README.md
Last active July 11, 2018 11:24
Toggle Greyscale on macOS

Toggle Greyscale on macOS

  1. Start Script Editor
  2. Paste the script found below
  3. Save as application
  4. Drag to dock, and use to toggle greyscale quickly on and off
tell application "System Preferences" to reveal anchor "Seeing_Display" of pane id "com.apple.preference.universalaccess"
@marcusstenbeck
marcusstenbeck / README.md
Last active July 11, 2018 19:39
Minimum Lovable Stack: PHP

Minimum Lovable Stack: PHP

(0. Install Docker: https://docs.docker.com/install/)

  1. Run docker-compose up
  2. Go to localhost:5000
  3. Edit index.php
  4. Reload localhost:5000
  5. Repeat (3)
module.exports = {
createStore() {
let events = [];
return {
getEvents() {
return events;
},
commit(event) {
events = [...events, event];
module.exports = function getShows(eventStore) {
return eventStore.getEvents()
.reduce((shows, event) => {
switch (event.type) {
case 'ShowAdded':
return [...shows, event.payload];
default:
return shows;
}
}, []);
const { makeExecutableSchema } = require('graphql-tools');
const { GraphQLDateTime } = require('graphql-iso-date');
const gql = require('graphql-tag');
const { createStore } = require('../event-store');
const addShow = require('../commands/addShow');
const getShows = require('../queries/getShow');
const eventStore = createStore();
const max50 = str => str.length <= 50;
module.exports = function addShow(
eventStore,
{
title,
time,
host,
location
}