Skip to content

Instantly share code, notes, and snippets.

@Et7f3
Et7f3 / engine.py
Created March 18, 2024 19:50 — forked from klali/engine.py
sample for using a yubihsm2 with python requests
try:
from OpenSSL._util import (
ffi as _ffi,
lib as O,
lib as S
)
pyopenssl = True
import sys
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 459802a..37bdf4b 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -93,6 +93,9 @@ typedef gboolean (*AskUserFunc) (const char *vpn_name,
gboolean need_password,
const char *existing_password,
char **out_new_password,
+ gboolean need_pin,
+ const char *existing_pin,
(* just some type to work in one file *)
module Lwt = struct
type 'a t = 'a ref
end
type process_in = int
type ('handler, 'return) onTimeout =
| Catch: float -> (exn -> process_in -> 'return Lwt.t, 'return) onTimeout
| Fail: float -> (process_in -> 'return Lwt.t, 'return) onTimeout
@Et7f3
Et7f3 / index.html
Last active May 3, 2020 17:40
Language toogle for ReasonML/OCaml
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example of toogle for OCaml/ReasonML docs.</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#lang-switch {
position: relative;
display: inline-block;

Demo:

Spoiler warning

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

console.log("I'm a code block!");
@Et7f3
Et7f3 / sizeof.c
Last active October 24, 2019 14:52
strange sizeof behaviour
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
@Et7f3
Et7f3 / esy-python.txt
Last active September 30, 2019 23:32
esy-python debug on windows
[ 0:58:23,02] X:\usr\root\Documents\esy-gtk $ esy echo "#{esy-python.bin}"
X:/usr/root/.esy/3_/i/esy_python-b190b433/bin
[ 0:58:25,30] X:\usr\root\Documents\esy-gtk $ dir /S/B "X:/usr/root/.esy/3_/b/esy_python-b190b433" | findstr \.exe
X:\usr\root\.esy\3_\b\esy_python-b190b433\externals\nuget.exe
X:\usr\root\.esy\3_\b\esy_python-b190b433\externals\pythonx86\tools\python.exe
X:\usr\root\.esy\3_\b\esy_python-b190b433\externals\pythonx86\tools\pythonw.exe
X:\usr\root\.esy\3_\b\esy_python-b190b433\externals\pythonx86\tools\Lib\site-packages\pip\_vendor\distlib\t32.exe
X:\usr\root\.esy\3_\b\esy_python-b190b433\externals\pythonx86\tools\Lib\site-packages\pip\_vendor\distlib\t64.exe
X:\usr\root\.esy\3_\b\esy_python-b190b433\externals\pythonx86\tools\Lib\site-packages\pip\_vendor\distlib\w32.exe
@Et7f3
Et7f3 / dune
Created August 27, 2019 15:22
OCaml-websocket+opium
(executable
(name host_web)
(libraries opium websocket-lwt-unix.cohttp))
@Et7f3
Et7f3 / main.bs.js
Last active August 25, 2019 10:51
Try compare ReactDOMRe.createElement vs ReactDOMRe.createElementVariadic
// Generated by BUCKLESCRIPT VERSION 5.0.4, PLEASE EDIT WITH CARE
'use strict';
var Block = require("./stdlib/block.js");
var Curry = require("./stdlib/curry.js");
var React = require("react");
var ReactDOMRe = require("./stdlib/reactDOMRe.js");
var a = React.createElement("div", undefined, "e");
@Et7f3
Et7f3 / minesweeper.re
Created May 18, 2019 21:10
minesweeper with revery
open Revery;
open Revery.UI;
let () = Random.self_init()
module Row = {
let component = React.component("Row");
let createElement = (~children, ()) =>
component(hooks => {