Skip to content

Instantly share code, notes, and snippets.

~/GraphTea  ./make.sh
Buildfile: /home/bruno/GraphTea/build.xml
clean:
[delete] Deleting directory /home/bruno/GraphTea/binary
[delete] Deleting directory /home/bruno/GraphTea/build
BUILD SUCCESSFUL
Total time: 0 seconds
Buildfile: /home/bruno/GraphTea/build.xml
@brunocalou
brunocalou / event-system.js
Created July 10, 2018 18:40
A simple yet powerful event system capable of dispatching events with any number of arguments
/**
* A simple yet powerful event system capable of dispatching events with any number of arguments
*
* @example
* const eventSystem = new EventSystem();
* eventSystem.on('my-event', () => console.log('hello event system'));
* eventSystem.on('my-event', () => console.log('hello from here too'));
*
* // In the future
* eventSystem.dispatch('my-event');
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Slider Test',
theme: ThemeData(
@brunocalou
brunocalou / Undoable.ts
Created August 17, 2022 14:59
Undo and Redo features in Typescript
type Timeline<State> = {
past: State[];
present: State;
future: State[];
};
export class Undoable<State> {
timeline: Timeline<State>;
constructor(initialValue: State) {