Standard escape codes are prefixed with Escape
:
- Ctrl-Key:
^[
- Octal:
\033
- Unicode:
\u001b
- Hexadecimal:
\x1B
- Decimal:
27
// $ em++ -lwebsocket.js -o index.html main.cpp | |
#include <emscripten/emscripten.h> | |
#include <emscripten/websocket.h> | |
#include <stdio.h> | |
EM_BOOL onopen(int eventType, const EmscriptenWebSocketOpenEvent *websocketEvent, void *userData) { | |
puts("onopen"); | |
EMSCRIPTEN_RESULT result; |
timers = {} | |
function after(delay, action, repeatable, after, tag) | |
local tag = tag or uid() -- uid returns a unique id every time it's called, "or" will resolve the expression to the result of uid() if tag is nil (the same as if not tag then tag = uid() end) | |
timers[tag] = {type = 'after', current_time = 0, delay = delay, action = action, repeatable = repeatable, after = after, tag = tag} | |
end | |
function tween(delay, target, source, method, after, tag) | |
local tag = tag or uid() | |
local initial_values = {} |
#include <stdio.h> | |
#include "bgfx/bgfx.h" | |
#include "bgfx/platform.h" | |
#include "bx/math.h" | |
#include "GLFW/glfw3.h" | |
#define GLFW_EXPOSE_NATIVE_WIN32 | |
#include "GLFW/glfw3native.h" | |
#define WNDW_WIDTH 1600 | |
#define WNDW_HEIGHT 900 |
#Run build-v8.sh to setup deps. | |
gn gen "--args=is_clang=true is_component_build=false v8_static_library=true use_custom_libcxx=false target_cpu=\"x64\"" out.gn/x64.Release | |
ninja -C out.gn/x64.Release/ |
#pragma once | |
#define DYN_ARR_OF(type) struct { \ | |
type *data; \ | |
type *endptr; \ | |
uint32_t capacity; \ | |
} | |
#if !defined(__cplusplus) | |
#define decltype(x) void* |
// | |
// cc glfw-metal-example.m `pkg-config --cflags --libs glfw3` -framework AppKit -framework Metal -framework QuartzCore | |
// | |
#define GLFW_INCLUDE_NONE | |
#define GLFW_EXPOSE_NATIVE_COCOA | |
#include <GLFW/glfw3.h> | |
#include <GLFW/glfw3native.h> | |
#import <Metal/Metal.h> | |
#import <QuartzCore/CAMetalLayer.h> |
// | |
// cc sdl-metal-example.m `sdl2-config --cflags --libs` -framework Metal -framework QuartzCore && ./a.out | |
// | |
#include <SDL.h> | |
#import <Metal/Metal.h> | |
#import <QuartzCore/CAMetalLayer.h> | |
int main (int argc, char *args[]) | |
{ | |
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal"); |
NOTE: The Tree-sitter API and documentation has changed and improved since this guide was created. I can't guarantee this is up to date.
Tree-sitter is the new way Atom is providing language recognition features, such as syntax highlighting, code folding, autocomplete, and more. In contrast to TextMate grammars, which work by regex matching, Tree-sitter will generate an entire syntax tree. But more on that can be found in it's own docs.
Here, we look at making one from scratch.
-- ~celeste~ | |
-- matt thorson + noel berry | |
-- globals -- | |
------------- | |
room = { x=0, y=0 } | |
objects = {} | |
types = {} | |
freeze=0 |