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; | |
use warnings; | |
sub nif_check { | |
my ($nif) = @_; | |
my $check = 0; | |
foreach my $i (reverse 0..7) { | |
$check += substr($nif, $i, 1) * (9-$i); | |
} | |
$check %= 11; |
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
IDENTIFICATION DIVISION. | |
PROGRAM-ID. ADD. | |
ENVIRONMENT DIVISION. | |
DATA DIVISION. | |
WORKING-STORAGE SECTION. | |
77 IDX PICTURE 9999. | |
77 SUMX PICTURE 999999. | |
77 X PICTURE X. | |
PROCEDURE DIVISION. | |
BEGIN. |
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
addEventListener('fetch', event => { | |
event.respondWith(fetchAndCheckPassword(event.request)) | |
}) | |
async function fetchAndCheckPassword(req) { | |
if (req.method == "POST") { | |
try { | |
const post = await req.formData(); | |
const pwd = post.get('password') | |
const enc = new TextEncoder("utf-8").encode(pwd) |
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
// loc_parser: functions to parse the textual part of a LOC record | |
// stored in our DNS. The key function here is parseLOCString which | |
// should be passed a dns.LOC and a string containing the latitude, | |
// longitude etc. | |
// | |
// This is an implementation of RFC 1876. Read it for background as | |
// the format in a dns.LOC is slightly unusual. | |
// | |
// Copyright (c) 2014 CloudFlare, Inc. |
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
#include <stdio.h> | |
#include <stdlib.h> | |
typedef unsigned long u64; | |
typedef void enc_cfg_t; | |
typedef int enc_cfg2_t; | |
typedef __int128_t dcf_t; | |
enc_cfg_t _ctx_iface(dcf_t s, enc_cfg2_t i) { |
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
// flashspi | |
// | |
// Small program to use with Arduino to connect to an SPI | |
// flash chip using the SPIMemory library. This program | |
// provides an interface over the serial connection at 115200 | |
// baud that supports the following commands: | |
// | |
// id - prints the JEDEC, manufacturer and unique ID | |
// cap - prints the flash chip's capacity in bytes | |
// dump - dumps the entire chip in hex (xxd format) |
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
74c74 | |
< #define LED_HB 9 | |
--- | |
> // #define LED_HB 9 | |
96c96 | |
< #define LED_HB 7 | |
--- | |
> // #define LED_HB 7 | |
231,232c231,241 | |
< pinMode(LED_HB, OUTPUT); |
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
1 SPEED= 240 | |
50 HOME | |
55 INPUT "";W$ | |
70 HTAB 9 | |
82 HTAB 9 | |
85 PRINT | |
90 FOR A = 1 TO 30 | |
100 R = RND (9) | |
140 HTAB 1 | |
150 PRINT SIN (R), |
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
code = { | |
'01': 'A', | |
'1000': 'B', | |
'1010': 'C', | |
'100': 'D', | |
'0': 'E', | |
'0010': 'F', | |
'110': 'G', | |
'0000': 'H', | |
'00': 'I', |
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
1 PP=2 | |
10 HOME | |
12 PRINT | |
20 A$ = "0123456789ABCDEF" | |
30 FOR I = 1 TO 19 | |
31 IF I = 9 THEN GOSUB 1000 | |
40 L$ = "" | |
45 FOR J = 1 TO 9 | |
50 L1 = INT ( RND (1) * 15 ) + 1: L2 = INT ( RND (1) * 15 ) + 1 | |
60 L$ = L$ + MID$ (A$,L1,1) + MID$(A$,L2,1) + ": " |
NewerOlder