- Common setup for engineers with
- laptop with encrypted hard drive
- automatic updates (possibly forced, disabling delay)
- password manager
- 2FA everywhere
- dedicated browser for development without extensions except for the ones approved by devsec ops
- VPN to access internal properties
- work (dedicate) GitHub account
- rotate passwords and tokens / keys
- remote dev machines on premise that can be kept secure and up to date by IT - might reduce chances to compromise engineer machine (accessible only via vpn)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @author mrdoob / http://mrdoob.com/ | |
| */ | |
| function WebAudio( context ) { | |
| if ( context === undefined ) { | |
| context = WebAudio.context; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class Cache<T extends object, K> { | |
| items = new WeakMap<T, K>() | |
| get<P extends T>(item: P, cb: (item: P) => K) { | |
| if (!this.items.has(item)) { | |
| this.items.set(item, cb(item)) | |
| } | |
| return this.items.get(item)! | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "2.0.0", | |
| "tasks": [ | |
| { | |
| "label": "Start Expo dev server", | |
| "type": "shell", | |
| "command": "cd ./apps/mobile && yarn start", | |
| "presentation": { | |
| "reveal": "always", | |
| "panel": "new", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react' | |
| import { SpringValue, easings, useSpring } from 'react-spring' | |
| /** | |
| * Hook that animates height when args.animationKey changes | |
| * | |
| * Ex: | |
| * const animatedBlock = useAnimatedHeight({ | |
| * animationKey: key, | |
| * }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as THREE from 'three' | |
| import { useFrame, extend } from '@react-three/fiber' | |
| import { useRef, useState } from 'react' | |
| import useStore from '@/helpers/store' | |
| import { shaderMaterial } from '@react-three/drei' | |
| import { Mesh } from "three" | |
| import vertex from './glsl/shader.vert' | |
| import fragment from './glsl/shader.frag' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type AnyFunction = (...args: any[]) => any | |
| function useEvent<T extends AnyFunction>(callback?: T) { | |
| const ref = useRef<AnyFunction | undefined>(() => { | |
| throw new Error("Cannot call an event handler while rendering.") | |
| }) | |
| // Or useInsertionEffect if it's React 18 | |
| useLayoutEffect(() => { | |
| ref.current = callback | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| Project, | |
| Type, | |
| Symbol, | |
| SymbolFlags, | |
| Signature, | |
| Node, | |
| TypeFormatFlags, | |
| } from 'ts-morph'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Run this code on tldraw.com | |
| // By @steveruizok | |
| // Based on an awesome image by @cacheflowe: https://twitter.com/cacheflowe/status/1408902719130288130 | |
| new NumberControl({ | |
| label: 'radius', | |
| value: 200, | |
| min: 50, | |
| max: 500, | |
| }) |