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
---- MODULE transfer ---- | |
EXTENDS Naturals, TLC | |
(* --algorithm transfer | |
variables alice_account = 10, bob_account = 10, | |
account_total = alice_account + bob_account; | |
process Transfer \in 1..2 | |
variable money \in 1..20; |
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 <string.h> | |
int main(void) { | |
// https://unicode-table.com/en/2764/ | |
const char *s = "❤"; | |
size_t len = strlen(s); | |
for (size_t i = 0; i < len; i++) { | |
printf("%02X", (unsigned char) s[i]); | |
putchar(i != len - 1 ? ' ' : '\n'); |
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
diff --git a/bin/mctop b/bin/mctop | |
index 20da5f8..f09070e 100755 | |
--- a/bin/mctop | |
+++ b/bin/mctop | |
@@ -23,7 +23,7 @@ sort_order = :desc | |
done = false | |
# trap most of the typical signals | |
-%w[ INT QUIT HUP KILL ].each do |sig| | |
+%w[ INT QUIT HUP ].each do |sig| |
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
<html> | |
<body> | |
<script> | |
fetch('https://upload.wikimedia.org/wikipedia/commons/3/31/Red-dot-5px.png') | |
.then(res => res.blob()) // Gets the response and returns it as a blob | |
.then(blob => { | |
// Here's where you get access to the blob | |
// And you can use it for whatever you want | |
// Like calling ref().put(blob) |
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
#!/usr/bin/env python3 | |
import gi | |
import os | |
gi.require_version('Gtk', '3.0') | |
def gi_import(name, ver): | |
try: | |
gi.require_version(name, ver) |
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
package main | |
import ( | |
"github.com/webview/webview" | |
"log" | |
) | |
func webFuncInjection() { | |
w := webview.New(true) | |
defer w.Destroy() |
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 <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <cstdint> | |
#include <cassert> | |
#include <isa-l_crypto.h> | |
#include <endian.h> | |
#define HASH_CTX_MGR SHA512_HASH_CTX_MGR | |
#define HASH_CTX SHA512_HASH_CTX |
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> | |
#include <string.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <isa-l_crypto.h> | |
#include <endian.h> | |
static MD5_HASH_CTX * | |
submit_flush(MD5_HASH_CTX_MGR *mgr, MD5_HASH_CTX *ctx, const void *buffer, HASH_CTX_FLAG flags) { |
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. Install podman | |
# https://podman.io/getting-started/installation#ubuntu | |
. /etc/os-release | |
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list | |
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install podman | |
# 2. Install missing dependencies |
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
#!/bin/bash | |
set -eufo pipefail | |
#set -x | |
tr -dc a-f0-9 < /dev/urandom | head -c 12 | sed -r 's/(..)/\1:/g;s/:$//1' |