View qemu-archlinux-aarch64.sh
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
wget http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz | |
qemu-img create root.img 32G | |
mkfs.ext4 root.img | |
mkdir root | |
sudo mount root.img root | |
sudo bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C root | |
sudo cp -r root/boot . | |
sudo umount root | |
qemu-system-aarch64 -M virt -cpu cortex-a72 -kernel boot/Image -hda root.img -append "root=/dev/vda rw" |
View azure-functions-managed-identity.sh
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
# az login | |
# check: az resource list | grep <your azure function name> | |
# If not available you also need to change subscription | |
# az account set --subscritipon <sub id, find this in portal, or by az account list> | |
webAppName="<your azure functions name here>" | |
spId=$(az resource list -n $webAppName --query [*].identity.principalId --out tsv) | |
graphResourceId=$(az ad sp list --display-name "Microsoft Graph" --query [0].id --out tsv) |
View insecureproxy.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
const http = require("http"); | |
const https = require("https"); | |
const fs = require("fs"); | |
const auth = `Basic ${Buffer.from( | |
process.env.PROXY_USER + ":" + process.env.PROXY_PASS | |
).toString("base64")}`; | |
function proxy(id, url, method, headers, data, origRes, withCa) { | |
const parts = url.split("/").slice(2); | |
return new Promise((resolve, reject) => { |
View qemu-arch-linux-raspi2.sh
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 bash | |
echo | |
echo "Arch Linux in QEMU with love from eirikb" | |
echo | |
set -x | |
TARGET=ArchLinuxARM-rpi-armv7-latest.tar.gz | |
wget "http://os.archlinuxarm.org/os/$TARGET" |
View firefox-container-tabs-sorter.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
const fs = require('fs'); | |
const os = require('os'); | |
const path = `${os.homedir()}/.mozilla/firefox`; | |
for (const dir of fs.readdirSync(path)) { | |
const file = [path, dir, 'containers.json'].join('/'); | |
if (fs.existsSync(file)) { | |
console.log('Fixing', file); | |
const containers = require(file); |
View fast-domdom.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 domdom from "@eirikb/domdom"; | |
import { | |
FASTDesignSystemProvider, | |
FASTButton, | |
FASTAccordion | |
} from "@microsoft/fast-components"; | |
const { React, init, on, set, get } = domdom(); | |
FASTDesignSystemProvider; |
View discord-remove-sidepanels.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
document.querySelector('*[class^=membersWrap]').style.display = 'none' | |
document.querySelector('*[class^=sidebar]').style.display = 'none' |
View test.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
const test = require('ava'); | |
const when = require('./when'); | |
const { sp } = require('@pnp/pnpjs'); | |
test('when', t => { | |
const mySp = when(sp); | |
mySp.web.getList('web/Lists/A').items.filter(`Title eq 'yes'`).get.thenReturn([{ Id: 1 }]); | |
mySp.web.getList('web/Lists/A').items.filter(`Title eq 'no'`).get.thenReturn([{ Id: 2 }]); | |
mySp.web.getList('web/Lists/B').items.filter(`Title eq 'yes'`).get.thenReturn([{ Id: 3 }]); |
View msal-outlook-native-hack.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
const isOutlookNative = Office.context.mailbox && Office.context.mailbox.diagnostics.hostName === 'Outlook'; | |
if (isOutlookNative) { | |
msal.openPopup = () => { | |
const dummy = { | |
close() { | |
}, | |
location: { | |
assign(url) { | |
Office.context.ui.displayDialogAsync(url, { width: 25 }, res => { |
View run-durable-functions-async-without-emulator.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
const fs = require('fs'); | |
const head = () => { | |
Object.assign(process.env, require('../local.settings').Values); | |
const orchestrators = {}; | |
console.log.error = console.error; | |
const context = { log: console.log }; | |
const setInput = input => context.bindings = { input: { input } }; | |
const df = { | |
orchestrator(cb) { |
NewerOlder