Skip to content

Instantly share code, notes, and snippets.

View rupertlssmith's full-sized avatar

Rupert Smith rupertlssmith

  • The Sett Ltd.
  • Edinburgh, Scotland.
View GitHub Profile
@paleo9
paleo9 / xen-and-systemd
Created November 3, 2012 16:01
Integrating Xen 4.2 with Systemd.
Integrating Xen 4.2 AUR with Systemd.
=================================
I tested the AUR package with a fresh installation of Arch of x86_64. Only
packages 'base', 'base-devel'and the dependencies mentioned on the site
were installed.
* package build also requires dev86
* dev86 is in multilib, x86_64 users need to enable multilib in /etc/pacman.conf
* users need to add a new entry to their bootloader config file (mentioned)
@evancz
evancz / Architecture.md
Last active December 21, 2022 14:28
Ideas and guidelines for architecting larger applications in Elm to be modular and extensible

Architecture in Elm

This document is a collection of concepts and strategies to make large Elm projects modular and extensible.

We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp. You will probably merge a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:

  1. There is a single source of truth. Traditional approaches force you to write a decent amount of custom and error prone code to synchronize state between many different stateful components. (The state of this widget needs to be synced with the application state, which needs to be synced with some other widget, etc.) By placing all of your state in one location, you eliminate an entire class of bugs in which two components get into inconsistent states. We also think yo
@dasniko
dasniko / nashorn-polyfill.js
Last active May 28, 2018 15:40
necessary JavaScript polyfills for working with Nashorn JS-engine
var global = this;
var window = this;
var process = {env: {}};
var console = {};
console.debug = print;
console.warn = print;
console.log = print;

Lightning Talk proposal for ReactiveConf 2017 http://www.reactiveconf.com #ReactiveConf

Porting Prezi to Elm in 99 lines of code

Elm is a statically-typed functional programming language. Its compiler produces safe JavaScript which is guaranteed to be free of runtime exceptions. Moreover Elm is packed with a bunch of powerful abstractions which let us build visual and reactive Web applications in a few lines of code.

As an example, I show the implementation of a simple framework for building Prezi-like presentations. It's just 99 lines of code!

@rupertlssmith
rupertlssmith / GameState.elm
Last active July 21, 2023 01:09
Exploring State Machines with phantom types in Elm
module GameState
exposing
( Game(..)
, GameDefinition
, PlayState
, loading
, updateGameDefinition
, updatePlayState
, updateScore
, toReady
@lukewestby
lukewestby / CodeEditor.elm
Last active December 9, 2021 08:12
The custom element and Elm API that will drive Ellie's code editors
module Ellie.Ui.CodeEditor
exposing
( Attribute
, LinterMessage
, Position
, Severity(..)
, linterMessages
, mode
, onChange
, readOnly
@charbelrami
charbelrami / elm-grammar.ebnf
Created January 26, 2024 13:41
Elm EBNF grammar
program = [ comment ], [ "port" ], "module", module_name, "exposing", "(", exposed_list, ")", { import_statement }, { declaration }, { comment };
module_name = identifier, { ".", identifier }, [ comment ];
exposed_list = identifier | "(", identifier, { ",", identifier }, ")", [ comment ] | "..";
import_statement = "import", module_name, [ import_alias ], [ "exposing", "(", exposed_list, ")" ], [ comment ];
import_alias = "as", identifier, [ comment ];
declaration = type_declaration
| type_alias_declaration