Closes JIRA-XXXX
- π Bug fix
- β¨ New feature
# Deploy frontend after successful backend deployment in sequence | |
# If frontend changed, deploy only frontend | |
# If backend changed, deploy only backend | |
# If frontend and backend, deploy frontend after backend | |
name: "Deploy services" | |
on: | |
push: | |
branches: ["main"] | |
jobs: |
/** | |
Value first, might be nicer | |
@example | |
const [value] = tryCatch(doSomething()) | |
if (!value) { | |
// something went wrong | |
} | |
*/ | |
const tryCatch = async <TSuccess, TError extends Error>( |
import { getBrowserPlatform } from '@/src/lib/browser-platform/browser-platform'; | |
const DESKTOP_UA = | |
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36'; | |
const IPHONE_UA = | |
'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1'; | |
const ANDROID_UA = | |
'Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.91 Mobile Safari/537.36'; | |
describe('browser-platform', () => { |
Original article: https://apoorv.blog/typed-css-modules-reactjs/
yarn add --dev typescript-plugin-css-modules
# Convert a video file to 720p with 24fps | |
/opt/homebrew/bin/ffmpeg -i "$@" -preset slow -codec:a aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 2500k -minrate 1500k -maxrate 4000k -bufsize 5000k -vf scale=-1:720 -filter:v fps=24 "[email protected]" | |
# Simpler | |
/opt/homebrew/bin/ffmpeg -y -i "$@" -preset slow -codec:a aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 2500k -filter:v "scale=-2:720, fps=48" "[email protected]" | |
# Convert audio to .mp3 | |
/opt/homebrew/bin/ffmpeg -y -i "$@" -vn -ar 44100 -ac 2 -b:a 192k "[email protected]" |
import { PerspectiveCamera } from "three"; | |
export const getDepthPositionMult = (depth: number, camera: PerspectiveCamera) => { | |
const { aspect, fov } = camera; | |
const vFov = (fov * Math.PI) / 180; | |
const planeHeightAtDistance = | |
2 * Math.tan(vFov / 2) * (depth + camera.position.z); | |
const planeWidthAtDistance = planeHeightAtDistance * aspect; |
import { useEffect, useRef } from "react"; | |
const UP = "ArrowUp"; | |
const DOWN = "ArrowDown"; | |
const LEFT = "ArrowLeft"; | |
const RIGHT = "ArrowRight"; | |
const B = "b"; | |
const A = "a"; | |
export const KONAMI_CODE = [UP, UP, DOWN, DOWN, LEFT, RIGHT, LEFT, RIGHT, B, A]; |
import React from 'react' | |
import { useGlobalState } from '../hooks/useGlobalState.js' | |
export default function App () { | |
// The first time we call useGlobalState, we can set the default state, ignored after that. | |
const [ globalState, setGlobalState ] = useGlobalState({ | |
count: 0, | |
theme: 'light' | |
}) |
/* | |
Usage | |
init () { | |
const renderer = new THREE.WebGLRenderer() | |
const camera = new THREE.PerspectiveCamera() | |
renderer.autoClear = false // turn off clearing of renderer on each render-call | |
const scene1 = new THREE.Scene() // scene with stencil objects |