Skip to content

Instantly share code, notes, and snippets.

@Et7f3
Et7f3 / maria-work-around.spec
Last active October 16, 2024 13:19
Run this command to build the .rpm: rpmbuild -ba maria-work-around.spec --define "dist el8" --define "_rpmdir `pwd`"
Name: maria-workaround
Version: 1.0
Release: 1%{?dist}
License: ASL 2.0
BuildArch: noarch
Summary: Meta package that fix typo
requires: mariadb
provides: MariaDB-client
@Et7f3
Et7f3 / gist:922260074697e585bb492b5f2e7e1166
Last active August 27, 2024 18:13 — forked from simonw/gist:7000493
How to use custom Python JSON serializers and deserializers to automatically roundtrip complex types.
import json, datetime
class RoundTripEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return "$dt$" + str(obj.isoformat())
return super().default(obj)
data = {
"name": "Silent Bob",
@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))