Skip to content

Instantly share code, notes, and snippets.

View scttcper's full-sized avatar
🌮

Scott Cooper scttcper

🌮
View GitHub Profile
@lithdew
lithdew / Dockerfile
Created April 4, 2024 20:31
Dockerfile for deploying a Next.js standalone bundle on Fly.io with Bun.
# syntax = docker/dockerfile:1
# Adjust BUN_VERSION as desired
ARG BUN_VERSION=1.1.1
FROM oven/bun:${BUN_VERSION}-slim as base
LABEL fly_launch_runtime="Next.js"
# Next.js app lives here
WORKDIR /app
import * as React from 'react';
const useIsFirstRender = (): boolean => {
const isFirst = React.useRef(true);
if (isFirst.current) {
isFirst.current = false;
return true;
} else {
@martinwoodward
martinwoodward / mermaid.md
Created February 11, 2022 20:34
GitHub HTML Rendering Pipeline
```mermaid
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
 iframe->>dotcom: iframe ready
@sindresorhus
sindresorhus / esm-package.md
Last active May 4, 2024 15:48
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@mdo
mdo / 00-intro.md
Last active March 24, 2024 08:04
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@maxrimue
maxrimue / readme.md
Last active March 13, 2021 12:21
Use yarn with Greenkeeper

Use yarn with Greenkeeper

When using yarn, it will create a yarn.lock lockfile which holds data on your used dependencies. This file also includes hard-typed versions, so should you update your dependencies, the yarn.lock file is basically outdated and needs to be regenerated. While yarn does this automatically, Greenkeeper pull requests that update dependencies as of right now do not do this regeneration, which means you would have to do it manually.

This gist shows you a way how to automatise this step using a Travis CI script.

Prerequisites

  • You use Travis CI and have it build Pull Requests (default behaviour)
  • You have a yarn.lock file in your repository for Travis CI to automatically install yarn (yarn will be added to their default images soon)

Getting started

# lazyload nvm
# all props goes to http://broken-by.me/lazy-load-nvm/
# grabbed from reddit @ https://www.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/
lazynvm() {
unset -f nvm node npm npx
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
if [ -f "$NVM_DIR/bash_completion" ]; then
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@guycalledseven
guycalledseven / osx_yosemite_disable_features.sh
Last active August 16, 2021 01:57
Disabling OSX Yosemite annoyances / features I have no use of
# Tested on OSX Yosemite 10.10.4
# there is also an updated version (work in progress) for El Capitan here https://gist.github.com/guycalledseven/31ffe35eca056838b06b
# XXX TODO
# should I disable com.google.Keystone.Agent ??
# http://applehelpwriter.com/2014/07/13/how-to-remove-googles-secret-update-software-from-your-mac/
# Stop DS_Store file creation on network connections
# restart Finder afterwards
@mikedamm
mikedamm / gist:d0ef2291a3c4eecdc35a
Created September 25, 2014 00:20
Remove McAfee Endpoint Security for Mac without uninstall password
rm -f /Library/LaunchAgents/com.mcafee.menulet.plist
rm -f /Library/LaunchAgents/com.mcafee.reporter.plist
rm -f /Library/LaunchDaemons/com.mcafee.ssm.Eupdate.plist
rm -f /Library/LaunchDaemons/com.mcafee.ssm.ScanFactory.plist
rm -f /Library/LaunchDaemons/com.mcafee.virusscan.fmpd.plist
rm -rf /Library/Application\ Support/McAfee
rm -rf /usr/local/McAfee
shutdown -r now