Skip to content

Instantly share code, notes, and snippets.

View mediator.cs
public interface Button {
void Click();
public interface Label {
void setText(string text);
string getText();
View intercept.lua
local intercept = {}
function intercept.before(func, callback)
return function(...)
return func(...)
function intercept.after(func, callback)
View example.lua
local hooks = require("hooks") -- loads hooks.lua from same dir
hooks.add("test", "a", function(num) print("a", num) end)
hooks.add("test", "b", function(num) print("b", num + 2) end)"test", 4)
hooks.remove("test", "a")"test", 4)
maritaria / consumer.h
Created January 15, 2018 02:25
AspectC++ Mixing functional and interaction code
View consumer.h
#ifndef __CONSUMER_H__
#define __CONSUMER_H__
#include <algorithm>
#include <iostream>
#include <vector>
typedef int TimeSlot;
class Consumer {
maritaria / classes.lua
Created January 12, 2018 12:46
Lua multiple views solution
View classes.lua
local classes = {}
local registry = {}
function classes.createClass(classname)
local class = {}
class.__views = {}
registry[classname] = class
return class
View inheritance.1.cs
public class Patient
protected string Name;
protected MedicalRecords MedicalRecords;
protected List<Surgery> ScheduledSurgeries;
maritaria / Program.cs
Created June 8, 2017 17:28
Hash collision test (using blocks to reach larger coordinates
View Program.cs
using System;
using System.Collections.Generic;
namespace ConsoleApplication4
public class Program
private struct Vector
private int x, y, z;
View presentation
- Code for real-time measurements & logging
- Instrumentation for testing / benchmarking
- Runtime tools
Use cases (with examples)
- Benchmarking impact of new or updated features (regression testing)
- Realtime monitoring to create alerts when performance lowers
- Analysing production logs to find bottlenecks / memoryleaks
public static void main(String[] args){
Model schema = FileManager.get().loadModel("test_ontology.xml");
Model data = FileManager.get().loadModel("royal92.owl");
Reasoner reasoner = ReasonerRegistry.getRDFSReasoner();
reasoner = reasoner.bindSchema(schema);
InfModel infmodel = ModelFactory.createInfModel(reasoner, data);
final String NS = "";
maritaria / main.cs
Created December 11, 2016 23:13
Reproduction code
View main.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;
namespace CompilerGeneratedEnhancement
// Token: 0x02000002 RID: 2