sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts prevail!
This file contains hidden or 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 ruby | |
# prints all happy numbers <= 100 | |
# https://en.wikipedia.org/wiki/Happy_number | |
# returns true, if the number is happy | |
def happy?(n) | |
n = n.digits.sum { |x| x * x } while n > 6 | |
n == 1 | |
end |
This file contains hidden or 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
using UnityEngine; | |
using UnityEngine.Events; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
// creates a toolbar with two buttons with a C# script, without prefabs | |
// extension method to set all values of a RectOffset to the same value | |
public static class Extensions | |
{ |
This file contains hidden or 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
# Python script to place components in a circle | |
# based on http://kevincuzner.com/2017/04/28/arranging-components-in-a-circle-with-kicad/ | |
# but ported to Python 3 and KiCad 5.x | |
# You can just open "Tools->Scripting Console" and paste the whole thing. | |
# Needs to be in 3 parts: first the import line, then the function definition (and hit enter twice), | |
# and finally the place_circle call. | |
# Since refs can't have spaces in the name, I also simplified the list creation with the split function. | |
import math, pcbnew |
This file contains hidden or 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
;;;; infix to prefix function and reader macro | |
;; BSD 2-Clause License | |
;; | |
;; Copyright (c) 2021, Frank Buss | |
;; All rights reserved. | |
;; | |
;; Redistribution and use in source and binary forms, with or without | |
;; modification, are permitted provided that the following conditions are met: | |
;; |
This file contains hidden or 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
starting server | |
receive address: rs1qahw577c0p6t95vsuz9ets6zdu3tewl2uu7mgh0 | |
mining coins | |
name: metaroot | |
blocks until auction starts: 6 | |
blocks until auction reveal: 4 | |
blocks until auction close: 9 | |
record on the blockchain: | |
{ | |
"records": [ |
This file contains hidden or 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 | |
# first create an API key at coinmarketcap.com. It is free for personal use. Set it in a variable: | |
export API_KEY="11111111-1111-1111-1111-111111111111" | |
# now you can call the API with curl, and extract the result with jq | |
# for example to get the quote for a crypto currency in USD: | |
coinquote() { | |
curl -s -H "X-CMC_PRO_API_KEY:$API_KEY" -H "Accept:application/json" \ | |
-d "symbol=$1&convert=USD" \ |
This file contains hidden or 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 <conio.h> | |
#include <time.h> | |
#include <stdlib.h> | |
extern void waitvsync(); | |
extern unsigned short setvideomode(); | |
extern void restorevideomode(unsigned short old); | |
extern void setcolor(unsigned short farbe); | |
extern void setpixel(unsigned short x,unsigned short y); |
This file contains hidden or 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
# library installation: | |
# pip3 install -U selenium | |
# pip3 install webdriver-manager | |
# | |
# usage: | |
# first start Chrome in debug mode: | |
# google-chrome --remote-debugging-port=1234 | |
# then: | |
# - sign in to MetaMask and select right network and account | |
# - connect to OpenSea |
This file contains hidden or 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 <assert.h> | |
#include <signal.h> | |
#include <stdio.h> | |
#include <execinfo.h> | |
/* | |
compile this program like this: | |
gcc -Wall -O0 -g -fsanitize=address -fno-omit-frame-pointer -finstrument-functions test.c -o test |