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 sys | |
import cv2 | |
import numpy as np | |
def custom_processing_function(b, g, r): | |
r = int(r) | |
g = int(g) | |
b = int(b) | |
y = (r+g+b)/3 | |
mdif = max(abs(y-r), abs(y-g), abs(y-b)) |
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
// OCR code for processing photos of data structured in tables without installation of any package | |
// use: swift recognize.swift photo.jpeg | |
// It should return the 2D structure as JSON | |
import Cocoa | |
import Vision | |
struct TableCell { | |
var x: Int | |
var y: Int |
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
// dns-sd -R gabo5 _arduino._tcp . 3005 ssh_upload=no | |
const express = require('express'); | |
const app = express(); | |
app.use((req, res, next) => { | |
console.log(Date.now(), req.method, req.url); | |
next(); | |
}); | |
app.post('/pgm/sync', (req, res) => { |
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
var net = require('net'); | |
var socket = net.connect(8080, "localhost", () => { | |
var request = "GET / HTTP/1.1\r\nHost: " + "localhost" + "\r\n\r\n"; | |
var rawResponse = ""; | |
socket.write(` | |
GET / HTTP/1.1 | |
Host: localhost | |
Connection: Upgrade |
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
// Ks0304 Keyestudio W5500 ETHERNET DEVELOPMENT BOARD (WITHOUT POE) | |
// minimal http client code with "EthernetWebServer" library from "Khoi Hoang" | |
#define SerialDebug Serial | |
#define DEBUG_ETHERNET_GENERIC_PORT SerialDebug | |
#define _ETG_LOGLEVEL_ 0 | |
#define USE_THIS_SS_PIN 10 | |
#define SENDCONTENT_P_BUFFER_SZ 512 | |
#include <SPI.h> | |
#define ETHERNET_LARGE_BUFFERS |
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
typedef unsigned char undefined; | |
typedef unsigned char byte; | |
typedef unsigned char dwfenc; | |
typedef unsigned int dword; | |
typedef long long longlong; | |
typedef unsigned int uint; | |
typedef unsigned long ulong; | |
typedef unsigned char undefined1; | |
typedef unsigned short undefined2; |
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, shrink-to-fit=no"> | |
<meta name="author" content="Gabriel Valky"> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/bootstrap-table.min.css"> | |
</head> |
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
ide->ocd+$qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;memory-tagging+#ec | |
ocd->ide+ | |
ocd->ide+ | |
ocd->ide$PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+#02 | |
ide->ocd+ | |
ide->ocd$vMustReplyEmpty#3a | |
ocd->ide+$#00 | |
ide->ocd+ | |
ide->ocd$QStartNoAckMode#b0 |
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
if [[ -z "${DOCKER}" ]]; then | |
cat > Dockerfile <<- EOM | |
FROM debian:trixie | |
WORKDIR /app | |
RUN apt update -y --fix-missing && apt upgrade -y | |
RUN apt install -y rsyslog build-essential libsystemd-dev systemd | |
COPY test.sh . | |
ENV DOCKER 1 | |
ENTRYPOINT ["bash", "test.sh"] | |
EOM |
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
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/xterm.css"/> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/xterm.js"></script> | |
<div id="terminal"> | |
<script> | |
var terminal = new window.Terminal({cursorBlink: true}); | |
terminal.open(document.querySelector('#terminal')); | |
terminal.onData(e => socket.send(e)); | |
var socket = new WebSocket(document.location.href.split("http").join("ws") + "terminal"); | |
socket.onmessage = msg => terminal.write(msg.data); |
NewerOlder