Skip to content

Instantly share code, notes, and snippets.

View radeusgd's full-sized avatar

Radosław Waśko radeusgd

View GitHub Profile
@radeusgd
radeusgd / OperationSynchronizer.java
Created June 23, 2023 08:34
An implementation for running maintenance actions triggered by a finalizer or scheduling them after a current DB operation finishes. It has a flaw that the maintenance actions may be run during finalization which is not desirable.
package org.enso.database.dryrun;
import com.oracle.truffle.api.TruffleLogger;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Function;
/**
* A helper for ensuring that only one database operation is running at a time, and that maintenance operations
Require Import List.
Import List.ListNotations.
Parameter var : Set.
Inductive expr : Set :=
| fvar : var -> expr (* to jest chyba niepotrzebne, ale może warto dodać żeby mieć takie właśnie zdania w stylu jakieś tam P *)
| and : expr -> expr -> expr
| or : expr -> expr -> expr
| arrow : expr -> expr -> expr
@radeusgd
radeusgd / pdot-mode.el
Created October 16, 2019 21:04
An Emacs mode for editing code in pDOT lambda calculus
;; pDOT-mode.el --- sample major mode for editing LSL. -*- coding: utf-8; lexical-binding: t; -*-
;; Copyright © 2017, by you
;; Author: your name ( your email )
;; Version: 2.0.13
;; Created: 26 Jun 2015
;; Keywords: languages
;; Homepage: http://ergoemacs.org/emacs/elisp_syntax_coloring.html
@radeusgd
radeusgd / .spacemacs.el
Created March 19, 2019 20:58
My spacemacs config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@radeusgd
radeusgd / proxy.py
Created January 18, 2019 23:22
A simple HTTP server that serves static files from given directory and redirects other requests to a given server
#! /usr/bin/env python3
import http.server
import socketserver
import argparse
import os
import os.path
import requests
import urllib.parse
parser = argparse.ArgumentParser(description='Process some integers.')
@radeusgd
radeusgd / luna-basic-syntax-highlighting.md
Last active March 20, 2019 14:12
Super simple syntax highliting for Luna langauge in Emacs. Better version will be available in the future (this one is not context aware and very hacky)

Installation instruction for new Spacemacs users.

  1. Install spacemacs http://spacemacs.org/
  2. Install Elm support (SPC f e d, add elm to list of installed layers and SPC f e R or just restart the editor)
  3. Open luna-basic.el
  4. M-x eval-buffer (M-x is usually Left Alt + x)
  5. Open a *.luna file or manually enable it by M-x luna-mode.
@radeusgd
radeusgd / lunahtml.py
Last active December 19, 2018 22:25
Generate HTML with Luna code
#!/usr/bin/env python3
import subprocess
import sys
import json
head = """
<head>
<style>
.Comment {
color: grey;
@radeusgd
radeusgd / lunalint.py
Last active December 19, 2018 21:53
Simple linter for Luna
#!/usr/bin/env python3
import subprocess
import sys
import json
if len(sys.argv) < 2:
print("Usage: linter.py [file]")
sys.exit(1)
with open(sys.argv[1], "r") as infile:
@radeusgd
radeusgd / revert.py
Last active May 22, 2018 11:28
Script reverting files from the new filetracker format to the old one
"""Script reverting from new filetracker format to the old one."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import errno
import os
import sys
@radeusgd
radeusgd / compressors.py
Last active April 16, 2018 21:50
A tool to compute hashes and a comparison of original vs compressed file sizes.
import os
import sys
import datetime
import subprocess
def run_proc(*args):
return subprocess.check_output(args)