kommuner-2019-2020.json (Alle kommuner som har blitt endret).
postnummer.json (Alle postnummer med kommunenummer, gruppert på postnummer).
View firefox-container-tabs-sorter.js
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
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
document.querySelector('*[class^=membersWrap]').style.display = 'none' | |
document.querySelector('*[class^=sidebar]').style.display = 'none' |
View test.js
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
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
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) { |
View normalize-table.js
module.exports = table => { | |
const res = []; | |
table.querySelectorAll('tbody tr').forEach((row, y) => | |
row.querySelectorAll('td').forEach((cell, x) => { | |
const rowspan = Number(cell.getAttribute('rowspan') || 1); | |
const colspan = Number(cell.getAttribute('colspan') || 1); | |
while (res[y] && res[y][x]) x++; | |
for (let yy = y; yy < y + rowspan; yy++) { | |
const resRow = res[yy] = res[yy] || []; |
View 2019-2020-knr-gnr.js
const data = require('./2019-2020-knr-gnr.json'); | |
/** | |
* @typedef {Object} Matrikkel | |
* @property {string} knr - Kommunenummer | |
* @property {number} gnr - Gårdsnummer | |
*/ | |
function sanitizeKnr(knr) { | |
return String(knr || '').padStart(4, '0'); |
View 2019-2020-kommuenummer-postnummer.md
View app.js
import "core-js/stable"; | |
import "regenerator-runtime/runtime"; | |
import 'whatwg-fetch'; | |
import { UserAgentApplication } from 'msal'; | |
const clientId = '<PUT YOUR CLIENT ID HERE>'; | |
const scopes = ['User.Read']; | |
const msal = new UserAgentApplication({ auth: { clientId } }); | |
const p = document.querySelector('p'); |
NewerOlder