Skip to content

Instantly share code, notes, and snippets.

View yorickpeterse's full-sized avatar

Yorick Peterse yorickpeterse

View GitHub Profile
import std::drop::(Drop)
import std::stdio::STDOUT
import std::iter::Iter
class Node[T] {
let @next: Option[Node[T]]
let @prev: Option[mut Node[T]]
let @value: T
fn mut take_next -> Option[Node[T]] {
import std::fmt::(Formatter, Format)
import std::test::Tests
import std::cmp::Equal
let DASH = 45
class pub enum Argument {
case Positional(String)
case Long(String, Option[String])
case Short(String, Option[String])
# frozen_string_literal: true
module Gitlab
module BackgroundMigration
# Background migration for fixing merge_request_diff_commit rows that don't
# have committer/author details due to
# https://gitlab.com/gitlab-org/gitlab/-/issues/344080.
#
# This migration acts on a single project and corrects its data. Because
# this process needs Git/Gitaly access, and duplicating all that code is far
#!/usr/bin/env python
import neovim
import time
import re
import subprocess
def memory_of(pid):
file = open('/proc/{}/status'.format(pid), 'r')
-- 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;
(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))
# __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)
# 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
# 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
![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)