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
program : statement_seq | |
statement_seq : statement {sep statement} | |
statement : var_decl | |
| class_decl | |
| method_decl | |
| "if" expression opt_then statement_seq ["else" statement_seq] "end" | |
| "while" expression opt_do statement_seq "end" | |
| "return" expression |
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
// Compiler | |
// | |
static void endScope() { | |
current->scopeDepth--; | |
while (current->localCount > 0 && | |
current->locals[current->localCount - 1].depth > | |
current->scopeDepth) { | |
if (current->locals[current->localCount - 1].isCaptured) { |
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
package io.andersonsp.ulid | |
import scala.util.{Failure, Success, Try} | |
import java.security.SecureRandom | |
// The components are encoded as 16 octets. Each component is encoded with the Most Significant Byte first (network byte order). | |
// 0 1 2 3 | |
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | |
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
// | 32_bit_uint_time_high | |
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
// Uncompressed version of | |
// https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604 | |
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#include <stdbool.h> // 2008-2019 | |
const int HEIGHT = 40; | |
const int WIDTH = 80; |
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
# roxlu - 2019-08-04 - Blender 2.8 | |
# ------------------------------------------------ | |
# Very basic script that exports the vertices of the selected object | |
# to a .h and .cpp that you can use into your graphics app directly. | |
# Vertices are rotated to Y-up, -Z forward, following common OpenGL. | |
# | |
# | |
# Version: | |
# ------------------------------------------------ | |
# v0.0.0 - 2019-08-04: First release |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
enum { | |
CW_LIT, CW_COMPILE, CW_CALL, CW_JMP, | |
CW_DEF, CW_IMM, CW__TOK, CW__EXEC, CW_EXIT, CW_ECHO, | |
CW_LAST | |
}; |
NewerOlder