Skip to content

Instantly share code, notes, and snippets.

View mertyildiran's full-sized avatar
:octocat:
Doing some octopus work

M. Mert Yildiran mertyildiran

:octocat:
Doing some octopus work
View GitHub Profile
@mertyildiran
mertyildiran / 01.yaml
Created May 15, 2021 23:49
Mockintosh: mocks for microservice environments - Part 1: Configuration Syntax
services:
- port: 8081
endpoints:
- path: "/example"
response: "hello world"
Bytecode:
[PC: 0] LII R0A 1
[PC: 3] LII R1A 2
[PC: 6] PUSH R1A
[PC: 8] PUSH R0A
[PC: 10] LII R0A 50
[PC: 13] PUSH R0A
[PC: 15] LII R0A 3
[PC: 18] LII R1A 1
[PC: 21] PUSH R1A
@mertyildiran
mertyildiran / dev.md
Last active March 19, 2021 17:01
How render_part() works?

How render_part() works?

render_part() method in recognizers.py module is not doing just plain template rendering.

It does, in order:

  • Automatic Regex Conversion
  • Template Rendering (with regEx is the only available/injected method in the context)
  • Variable Detection
def tak(x, y, z):
if y < x:
return tak(
tak(x-1, y, z),
tak(y-1, z, x),
tak(z-1, x, y)
)
else:
return z
#line 3 "lex.yy.c"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
num def f1()
num a = 101
return a
end
num def f2()
num b = 102
return b
end
interpreter/module.c(36):freeing 0x701000000020 &0x7ffd888a9d00
utilities/helpers.c(123):freeing 0x701000000a30 &0x7ffd888a9b58
interpreter/function.c(147):freeing 0x701000000a40 &0x7ffd888a9be8
interpreter/function.c(171):freeing 0x70a0000000a0 &0x262e100
utilities/helpers.c(123):freeing 0x701000000a80 &0x7ffd888a9b58
interpreter/function.c(147):freeing 0x701000000a90 &0x7ffd888a9be8
interpreter/function.c(171):freeing 0x70a0000000a0 &0x262e100
utilities/helpers.c(123):freeing 0x701000000ad0 &0x7ffd888a9b58
interpreter/function.c(147):freeing 0x701000000ae0 &0x7ffd888a9be8
interpreter/function.c(171):freeing 0x70a0000000a0 &0x262e100
/*
* Intermediate C source code generated by Chaos Programming Language
* Language Reference: https://chaos-lang.org
*
* Filename: list.c
*/
#include <math.h>
#include "list.h"
@mertyildiran
mertyildiran / run.py
Created November 6, 2020 02:18
Homework iterator
#!/bin/python3
import glob
import subprocess
import psutil
def kill(proc_pid):
process = psutil.Process(proc_pid)
for proc in process.children(recursive=True):
@mertyildiran
mertyildiran / commit.patch
Created October 9, 2020 08:36
Fix to Valgrind & longjmp issue in Chaos language
diff --git a/interpreter/errors.c b/interpreter/errors.c
index 53e082d..b0161dd 100644
--- a/interpreter/errors.c
+++ b/interpreter/errors.c
@@ -173,7 +173,7 @@ void throw_error_base(unsigned short code, char *str1, char *str2, long long lld
exit(code);
} else {
#ifndef CHAOS_COMPILER
- longjmp(InteractiveShellErrorAbsorber, 1);
+ absorbError();