- 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)
View _app.tsx
This file contains 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 Head from "next/head"; | |
import * as React from "react"; | |
import "../styles/global.css"; | |
export default function MyApp({ Component, pageProps }) { | |
/* | |
Page components can add the tw property to the component page to enable Tailwind, eg: | |
AboutPage.tw = true; | |
export default function AboutPage { ... } |
View splinedesign-autorecording.js
This file contains 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
// cmd+j and paste then proceed with frame recording | |
// when you press start it'll automatically start recording too. | |
document.addEventListener('click', async e => { | |
if (e.target.closest('button[class*="ExportButton"]')) { | |
let button | |
while (!button) { | |
button = document.querySelector('[class^="Timer_container"] + button') | |
if (!button) { | |
await new Promise(r => setTimeout(r)) |
View remix-actionError.ts
This file contains 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 { json } from "@remix-run/node"; | |
import type { ZodIssue } from "zod"; | |
import { z } from "zod"; | |
type ActionData<T> = { | |
ok: false; | |
data: T; | |
errors: ZodIssue[]; | |
}; |
View chatroom.js
This file contains 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
// Adapted from https://github.com/go717franciswang/peerjs-chatroom | |
const CLIENT_MSG = { | |
CHAT: 1, | |
GET_MEMBERS: 2, | |
}; | |
const SERVER_MSG = { | |
CHAT: 1, | |
MEMBERS: 2, |
View just.sublime-snippet
This file contains 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
<snippet> | |
<content><![CDATA[ | |
import ${1:just} from "just-${2:package}"; | |
]]></content> | |
<tabTrigger>just</tabTrigger> | |
</snippet> |
View NFTLoremIpsum.sol
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
contract NFTLoremIpsum is ERC721, Ownable { | |
constructor() ERC721("Lorem Ipsum", "NFTLI") {} | |
uint public totalSupply; |
View rotate-classnames.js
This file contains 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
// setup | |
let classes = ['a','b','c'] | |
let counter = 0 | |
el.classList.add(classes[counter]) | |
function rotate() { | |
counter++ | |
el.classList.replace( | |
classes[(counter-1) % classes.length], | |
classes[(counter) % classes.length] |
View mediarecorder-check-mimeType.js
This file contains 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
window.navigator.mediaDevices | |
.getUserMedia({ | |
audio: true, | |
video: false, | |
}).then(mediaStream => { | |
const rec = new MediaRecorder(mediaStream) | |
rec.start() | |
setTimeout(() => { | |
rec.stop() | |
alert('mime-type: ' + rec.mimeType) |
View basic-security.md
View track-debugging-attempt.js
This file contains 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
function track(name) { | |
const dummy = /./; | |
dummy.toString = () => { | |
alert(`${name} was debugged`); | |
return 'tracked'; | |
}; | |
return dummy; | |
} | |
function test() { |
NewerOlder