You are shipwrecked on a desert island with nothing but your own company and a solar powered laptop with the Node.js, Golang and Python3 or you prefered development environment installed. Without internet access you're driven, by boredom to scratch in the sand where you find a compass and a scroll left behind by some algorithmically minded pirates. The scroll has a set of instructions of how to find hidden treasure and a working satellite phone. You decide to follow them and escape the island so you can return home to the good weather and political stability of the island you live.
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
export async function getAuthorizeUrl({redirectUri}:GetAuthorizeUrlOptions){ | |
const authorizeUrl = new URL("https://controller.sandbox.myoneid.co.uk/v2/authorize"); | |
authorizeUrl.searchParams.set("client_id", process.env.ONEID_CLIENT_ID); | |
authorizeUrl.searchParams.set("redirect_uri", redirectUri!); | |
authorizeUrl.searchParams.set("response_type", "code"); | |
authorizeUrl.searchParams.set("scope", "product:identity_proof"); | |
//TODO: Store state in client storage | |
authorizeUrl.searchParams.set("state", "state"); | |
return authorizeUrl.toString(); | |
} |
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
blueprint: | |
name: Motion-activated switch with sun condition | |
description: Turn on a switch when motion is detected during night. | |
domain: automation | |
input: | |
motion_entity: | |
name: Motion Sensor | |
selector: | |
entity: | |
domain: binary_sensor |
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
process.argv | |
.slice(2) | |
.map(b => [...b].reduce((a, b) => 2 * a + +("." == b ? 1 : 2), 0)) | |
.map( | |
a => "-etianmsurwdkgohvf-l-pjbxcyzq--54-3---2--+----16=/-----7---8-90"[a] | |
) | |
.join("") |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<a href="http://www.example.cₒm">test</a> | |
</body> |
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
/* | |
|| Compression and decompression using a combination of | |
|| Variable-length Quantity(VLQ) and Delta encoding to encode the "Additional | |
|| Consent" (AC) string required by Google’s Additional Consent Mode technical | |
|| specification https://support.google.com/admanager/answer/9681920?hl=en | |
|| | |
|| vendorIds.compress(input) | |
|| input - A string of "." delimited list if ids in ascending order. | |
|| | |
|| vendorIds.decompress(input) |
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
(function () { | |
var interval = setInterval(function () { | |
var [, xid] = (document.cookie.match(/CN_xi_d=([^;]+)/) || []); | |
xid = xid || window._4d && window._4d.user && window._4d.user.xid; | |
if (xid) { | |
permutive.identify([ | |
{ | |
id: xid, | |
tag: 'xid' | |
} |
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
console.log(process.argv.slice(2).map(b=>[...b].reduce((a,b)=>2*a+("."==b?1:2),0)).map(a=>"-etianmsurwdkgohvf-l-pjbxcyzq--54-3---2--+----16=/-----7---8-90"[a]).join('')) |
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
(function(doc) { | |
const TWO_PI = Math.PI * 2; | |
const HALF_PI = Math.PI / 2; | |
const RADIUS_SCALE = 0.05; | |
const RADIUS_SD = 15; | |
const POLYGON_SIDES = 5; | |
const POSITION_SD = 0.04; | |
const BASE_DEFORMATIONS = 3; | |
const LAYER_DEFORMATIONS = 3; | |
const LAYERS = 40; |
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
function bitLength(number) { | |
return Math.floor(Math.log2(number)) + 1; | |
} | |
function byteLength(number) { | |
return Math.ceil(bitLength(number) / 8); | |
} | |
function toBytes(number) { | |
if (!Number.isSafeInteger(number)) { |
NewerOlder