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
/******************************************************************************* | |
* | |
* A minimal Forth compiler in C | |
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com | |
* Release 2014-04-04 | |
* | |
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial | |
* | |
* PUBLIC DOMAIN | |
* |
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
right_of(X, Y) :- X is Y+1. | |
left_of(X, Y) :- right_of(Y, X). | |
next_to(X, Y) :- right_of(X, Y). | |
next_to(X, Y) :- left_of(X, Y). | |
solution(Street, FishOwner) :- | |
Street = [ | |
house(1, Nationality1, Color1, Pet1, Drinks1, Smokes1), | |
house(2, Nationality2, Color2, Pet2, Drinks2, Smokes2), |
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
# ------------------------------------ | |
# Docker alias and function | |
# ------------------------------------ | |
# Get latest container ID | |
alias dl="docker ps -l -q" | |
# Get container process | |
alias dps="docker ps" |
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
/** | |
* An approximate port of https://github.com/s-macke/VoxelSpace | |
* using static Groovy and JavaFX. | |
* | |
* Click on the panel to "fly". | |
* | |
* Run with : groovy voxel.groovy | |
* | |
* Twitter: @CedricChampeau | |
*/ |
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
/** | |
* An approximate port of https://github.com/s-macke/VoxelSpace | |
* using Kotlin and JavaFX. | |
* | |
* Run with : kotlinc -script voxel.kts | |
* | |
* Click on the panel to "fly". | |
* | |
* Twitter: @CedricChampeau | |
*/ |
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
use std::{ | |
f32, | |
io | |
}; | |
use minifb::{ | |
Key, | |
WindowOptions, | |
Window, | |
}; | |
use vek::*; |
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
/* | |
* This code is a headerless implementation of the WASI interface in C and prints "Hello World!. | |
* You only need clang and the llvm linker. | |
* | |
* compile with | |
* clang -Os -nostdlib --target=wasm32 -Wl,--allow-undefined hello.c -o hello.wasm | |
* | |
* run with | |
* https://runno.dev/wasi | |
* Just upload hello.wasm |
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 "C" | |
import ( | |
"fmt" | |
"github.com/giorgisio/goav/avcodec" | |
"github.com/giorgisio/goav/avutil" | |
"github.com/giorgisio/goav/swscale" | |
"strconv" | |
"strings" |
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
/* | |
The HTTP/3 protocol is on the rise and brings huge improvements in terms of speed and security. | |
One of them is, that the so called "Server Name Identification" or SNI is mandatory and is sent | |
in the first packet by the client. | |
https://en.wikipedia.org/wiki/Server_Name_Indication | |
Parsing and retrieving the SNI should be easy, right? | |
Well, here is a complete code example to retrieve the SNI and other information from the | |
initial QUIC packet. The first packet is encrypted and protected. But the encryption keys |
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
// compile with | |
// 'gcc -O2 main.c -o contextperf.c' -lpthread | |
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <pthread.h> | |
#include <sched.h> | |
#include <unistd.h> |
OlderNewer