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 <math.h> | |
struct position { | |
double x; | |
double y; | |
double z; | |
}; | |
int collisionDetection(struct position *positions, | |
double *radiuses, |
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
// __externref_t is a opaque pointer that will be translated to wasm externref. | |
__attribute__((import_name("receive_object"))) | |
__externref_t receive_object(void); | |
__attribute__((import_name("send_object"))) | |
void send_object(__externref_t); | |
int main() { | |
send_object(receive_object()); |
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
import WebSocket, { Server } from 'ws'; | |
const wss = new Server({ port: 28080 }); | |
let uniqueID = 0; | |
let clients: WebSocket[] = []; | |
wss.on('connection', function connection(ws) { | |
const clientId = uniqueID++; | |
clients.push(ws); |
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 <emscripten.h> | |
#include <functional> | |
#include <numeric> | |
#include <cassert> | |
#include <iostream> | |
std::function<void()> mainLoop; | |
void runMainLoop() | |
{ |
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
@echo off | |
setlocal | |
chcp 65001 > nul | |
set GitLog=%USERPROFILE%\git.log | |
set GitTmp=%USERPROFILE%\git.tmp | |
:: echo ^> git %* >> %GitLog% | |
if "%1" equ "rev-parse" goto rev_parse |
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 <cstdint> | |
#include <iostream> | |
int32_t add(int32_t n) { | |
int32_t sum; | |
__asm ( | |
"local.get %1\n" | |
"i32.const 1\n" | |
"i32.add\n" | |
"local.set %0" |
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/python3 | |
from clang.cindex import Index, Config, CursorKind | |
import json as JsonUtil | |
import os, io, sys | |
class MyTreeWalker: | |
def __init__(self): |
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 <emscripten.h> | |
struct vec2 | |
{ | |
float x, y; | |
}; | |
extern "C" | |
{ |
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 <future> | |
# include <chrono> | |
# include <iostream> | |
# include <experimental/coroutine> | |
# include <emscripten.h> | |
# include <emscripten/html5.h> | |
namespace std | |
{ |
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 <experimental/coroutine> | |
#include <thread> | |
#include <iostream> | |
#include <utility> | |
#include <optional> | |
#include <thread> |
NewerOlder