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
sudo timeshift --create --scripted --comments "Fresh install" &> /dev/null # first snapshot works but reports error | |
echo "*******Install Foundation*******" | |
sudo cp -rf /etc /etc.orig | |
# Allow sudo password prompts and sessions to last forever | |
print "\nDefaults env_reset,timestamp_timeout=-1,passwd_timeout=0\n" | sudo tee -a /etc/sudoers | |
# Set suspend to always suspend-then-hibernate | |
sudo ln -s /usr/lib/systemd/system/systemd-suspend-then-hibernate.service /etc/systemd/system/systemd-suspend.service |
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
#!/usr/bin/env zx | |
/* eslint-disable i18next/no-literal-string */ | |
// eslint-disable-next-line import/no-unresolved | |
import { startSpinner } from 'zx/experimental'; | |
import { | |
assertGit, | |
assertGithubCli, |
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
/** | |
* This CLI script will scrub/delete a translation from all translation files | |
*/ | |
const path = require('path'); | |
const fs = require('fs'); | |
const execSync = require('child_process').execSync; | |
const toDelete = process.argv[2]; |
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
#!/bin/bash | |
TIMEFORMAT=%R | |
function fetchWithGlobals { | |
curl 'https://zztr-140.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.store/Sites-RefArch-Site/en_US/HelloGlobals' \ | |
-H 'authority: zztr-140.sandbox.us01.dx.commercecloud.salesforce.com' \ | |
-H 'cache-control: max-age=0' \ | |
-H 'upgrade-insecure-requests: 1' \ | |
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36' \ | |
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \ |
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
'use strict'; | |
var ArrayN = { | |
findIndex: findIndex, | |
find: find, | |
includes: includes, | |
keyBy: keyBy, | |
test: test, | |
}; | |
Object.getOwnPropertyNames(Array).forEach(function(name) { |
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
'use strict'; | |
var ObjectN = { | |
assign: assign, | |
create: create, | |
entries: entries, | |
fromEntries: fromEntries, | |
pick: pick, | |
pickBy: pickBy, | |
omit: omit, |
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 fs from 'fs' | |
import * as glob from 'glob' | |
const datasource = fs.readFileSync('prisma/datasource.prisma') | |
const moduleFiles = glob.sync('src/**/*.prisma', {}) | |
const modules = moduleFiles.reduce((a,f) => { | |
const module = fs.readFileSync(f) | |
return a + module |
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
/** | |
* Class to make Indexed Database's easy for Key-Value Stores | |
* | |
* In addition to wrapping IDB, it also adds a feature for maxAge, | |
* which can discard records if createdAt + maxAge > now | |
* | |
* Adapted from https://github.com/elias551/simple-kvs | |
* - Adds timestamp field and garbage collection feature. | |
*/ | |
export default class KeyValueStore { |
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
#!/bin/sh | |
# Part of https://www.pbworks.net/ubuntu-guide-dropbear-ssh-server-to-unlock-luks-encrypted-pc/ | |
# Is a copy of https://gist.github.com/gusennan/712d6e81f5cf9489bd9f | |
PREREQ="dropbear" | |
prereqs() { | |
echo "$PREREQ" | |
} |
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
ID="shhh" | |
SECRET="shhh" | |
# Note the -n!!! | |
AUTH=`echo -n "$ID:$SECRET" | base64` | |
echo AUTH |