- 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 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() { |
View dependabot.yml
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
name: Update Dependencies | |
on: | |
schedule: | |
# https://crontab.guru/#0_0_*_*_WED,SAT | |
# Run every Wednesday and Saturday at 00:00 | |
# 0 0 * * WED,SAT | |
- cron: '0 0 * * WED,SAT' | |
jobs: | |
dependabot: |
View next-typed-api.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 { NextApiRequest as DefaultNextApiRequest, NextApiResponse } from "next"; | |
/** | |
* // Route /pages/api/posts/[id] | |
* | |
* const api = defineApi<{ id: string }>() | |
* .get<{ query: { foo: "1" } }, "foo" | "bar">( | |
* async function handler(req, res) { | |
* const session = await getSession({ req }); | |
* if (!session) { |
View streaming-styles.jsx
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 * as React from "react"; | |
/* | |
Usage | |
import { Style } from "style"; | |
function Heading({children}) { | |
return ( | |
<> | |
<Style>{`h1 { color: red }`}</Style> |
View lagcheck.mrc
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
on 1:connect: { | |
if (%Lagchk == on) { .timerLAG 0 %Lag.secs lagcheck } | |
} | |
alias lagcheck { .ctcpreply $me LAGGC $ticks } | |
on *:CTCPREPLY:LAGGC*: { if ($nick == $me) { set %lag $round($calc((($ticks - $2) / 2) / 1000),2) | echo -a $timestamp lag: %lag $+ secs.. | halt } } | |
alias lag { | |
if ($1 == on) { /set %lagchk on | echo -a Lag Meter: on. | goto { end } } | |
if ($1 == off) { /set %lagchk off | echo -a Lag Meter: off. | goto { end } } | |
if ($1 == delay) { set %Lag.secs $2 | echo -a Lag Meter: checking every: $2 $+ secs. | goto { end } } |
NewerOlder