Skip to content

Instantly share code, notes, and snippets.

@susisu
susisu / function.mjs
Created January 29, 2023 11:03
CloudFront Function for websites using CloudFront + S3 + Next.js static export (as of v13)
/* eslint-disable no-var, vars-on-top, no-param-reassign */
function redirect(uri) {
// remove repeated slashes
uri = uri.replace(/\/+/g, "/");
// remove trailing slash
if (uri !== "/" && uri.endsWith("/")) {
uri = uri.slice(0, -1);
}
return uri;
@Asparagirl
Asparagirl / gist:6206247
Last active January 28, 2025 14:38
Have a WARC that you would like to upload to the Internet Archive so that it can eventually be included in their Wayback Machine? Here's how to upload it from the command line.

Do you have a WARC file of a website all downloaded and ready to be added to the Internet Archive? Great! You can do that with the Internet Archive's web-based uploader, but it's not ideal and it can't handle really big uploads. Here's how you can upload your WARC files to the IA from the command line, and without worrying about a size restriction.

First, you need to get your Access Key and Secret Key from the Internet Archive for the S3-like API. Here's where you can get that for your IA account: http://archive.org/account/s3.php Don't share those with other people!

Here's their documentation file about how to use it, if you need some extra help: http://archive.org/help/abouts3.txt

Next, you should copy the following files to a text file and edit them as needed:

export IA_S3_ACCESS_KEY="YOUR-ACCESS-KEY-FROM-THE-IA-GOES-HERE"

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at [email protected] or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@albenik
albenik / horoscope.md
Last active January 28, 2025 14:34
Матерный гороскоп

хз чьё, сохранил, чтобы не потерять

Овен

Баран - он баран и есть. Всегда прав и ниибет. Проще убить сразу, чем начинать с ним спорить, потому что переспорить Овна возможно только в одном случае - если он слепоглухонемой безрукий и безногий инвалид (и то, есть огромный шанс, что даже в этом случае он все равно покажет вам хуй). Зато Овны честные. Иногда такие честные, что аж зубы сводит: предельно честно ответит, если вам не идет стрижка или платье полнит. С этим ничего не поделаешь, придется смириться (или убить, как уже говорилось выше). В домашних делах Овен, как правило, бесполезен - он умеет только генерировать гениальные идеи, а прахом бытия старается подошв не осквернять. Впрочем, если дать Овну понять, что Стрелец моет полы лучше его - костьми, сука, ляжет, но будет каждую субботу канифолить ваш паркет, потому что нет на свете вещи, которую Овен бы Стрельцу уступил. С Овном никогда не бывает скучно - этот знак обладает каким-то кармическим, сука, талантом искать приключения на свою прекрасную жоп

@LukeZGD
LukeZGD / ios-downgrade-dualboot.md
Last active January 28, 2025 14:34
Downgrade and dualboot status of almost all iOS devices

Downgrade and dualboot status of almost all iOS devices

UPDATED: 2024-12-01

@liquidx
liquidx / imx7-README.md
Last active January 28, 2025 14:33
Reflashing a TechNexion PICO-PI-IMX7

By: Alastair Tse @liquidx

Updated: 2021-12-05

This is a guide for installing Linux on a Technexion NXP IMX7 board. This is a board that was part of the Android Things Starter Kit (now discontinued).

There are some dead ends in this guide where I got to a point where I failed. I'm documenting this so that it can help anyone else who is trying the same thing.

Before starting, there are a few useful sources of information:

@doegox
doegox / fingerprint_mfc.py
Created September 10, 2024 20:22
Crappy script for fingerprinting MFC cards
#!/usr/bin/env python3
import time
MFINFO = True
ATS = True
FDT = True
NACK = True
SF = True
CMD00 = True
@mmozeiko
mmozeiko / !README.md
Last active January 28, 2025 14:32
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.40.33807 and v10.0.26100.0.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@bradtraversy
bradtraversy / terminal-commands.md
Last active January 28, 2025 14:30
Common Terminal Commands

Common Terminal Commands

Key Commands & Navigation

Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:

  • Up Arrow: Will show your last command
  • Down Arrow: Will show your next command
  • Tab: Will auto-complete your command
  • Ctrl + L: Will clear the screen
@pugson
pugson / sw.js
Created May 11, 2020 18:17
nuke your old service worker
// This is a worker that can be deployed in a desperate situation in order
// to disable all service worker caching by overwriting the running worker
// with a no-op worker.
//
// Keep it close for when you need it.
self.addEventListener("install", () => {
// Activate immediately, taking control from any broken service workers
self.skipWaiting();
});