Skip to content

Instantly share code, notes, and snippets.

Yorick Peterse YorickPeterse

Block or report user

Report or block YorickPeterse

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View reproduce.py
#!/usr/bin/env python
import neovim
import time
import re
import subprocess
def memory_of(pid):
file = open('/proc/{}/status'.format(pid), 'r')
View lol_rails.sql
-- Before
SELECT "namespaces".*
FROM "namespaces"
WHERE "namespaces"."type" IN ('Group')
AND "namespaces"."id" = 2
AND "namespaces"."type" IN ('Group')
AND "namespaces"."type" = 'Group'
ORDER BY "namespaces"."id" DESC
LIMIT 1;
View main.scm
(import bootstrap)
(import std integer)
(import std array)
(import std stdout)
(import std process)
; Defines the "main" module, #f indicating it has no explicit receiver. This means it will be defined
; in the default location.
(let main (defmod bootstrap "main" #f))
View closure.aeon
# __get_binding_of_caller and __run_code is a compiler hack to invoke VM
# instructions directly.
class Closure:
def construct(code):
let @code = code
let @binding = __get_binding_of_caller(_)
pub def call(args...):
__run_code(_, @code, args, @binding)
View 1_ping_pong.aeon
# The __foo stuff is a compiler hack for running raw instructions,
# so __foo runs the "foo" instruction. The single "_" stuff is to
# tell the compiler to automatically generate a register for a value.
class Pid:
def construct(id):
let @id = id
pub def id:
@id
View lexer.rb
# line 1 "lib/aeon/lexer.rl"
# line 3 "lib/aeon/lexer.rl"
module Aeon
class Lexer
# line 9 "lib/aeon/lexer.rb"
class << self
attr_accessor :_aeon_lexer_trans_keys
View bootstrap.aeon
![no_module]
let object_class = __get_toplevel(_)
let object_iproto = __set_object(_)
# Make sure that instance methods of Object are also available to Object (the
# class) itself.
__set_prototype(object_class, object_iproto)
__set_literal_attr(object_class, '__iproto', object_iproto)
View gist:cb5b1f58d7f10a4d3b96f24e28b87d77
aeon $ cat -n /tmp/test.aeon
1 class Integer:
2 # Overwrites the default prototype with the actual integer prototype.
3 __set_literal_attr(self, __get_integer_prototype(_), '__prototype')
4
5 def +(other):
6 __integer_add(_, self, other)
7
8 def -(other):
9 __integer_sub(_, self, other)
View gist:0e72898c5f7727de2303747ae62383bc
eon $ cat -n /tmp/test.aeon
1 def add(Integer left, Integer right) -> Integer:
2 return __integer_add(left, right)
3
4 def print(String message) -> Integer:
5 return __stdout_write(message)
6
7 def int_to_string(Integer int) -> String:
8 return __integer_to_string(int)
9
View gist:c162e5184a1f14c50f3d47ea65afe552
def add(Integer left, Integer right) -> Integer:
return __integer_add(left, right)
def print(String message) -> Integer:
return __stdout_write(message)
def int_to_string(Integer int) -> String:
return __integer_to_string(int)
let a = 10
You can’t perform that action at this time.