What? This project packages abstractions for JavaScript that proved to be useful in the Lively Web project. On first glance it might seem to be just another underscore.js library but apart from extensions to existing JavaScript objects and classes it also provides abstractions for asynchronous code, new object representations, and functions for inspecting JavaScript objects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jsPathSplitter(string) { | |
// STRING -> [STRING] | |
// ex: 'foo["bar"].x[0] -> ['foo', 'bar', x, '0']' | |
// for convenience even allows non-javascripty identifiers like foo.0.bar | |
return (function splitter(index, string, parts, term) { | |
if (string.length === 0) return parts; | |
if (index >= string.length) return parts.concat([string]); | |
if (string[index] === '\\') return splitter(index+2, string, parts, term); // escape char | |
var newTerm, skip = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro foo | |
[& [fn]] | |
`(let [env# 123] | |
~(when fn `(~fn env#)))) | |
;; then expanded form of env does not match: | |
(macroexpand '(foo identity)) ;=> (let* [env__17699__auto__ 123] (identity env__17698__auto__)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lively.morphic.CodeEditor.prototype.setTheme = lively.morphic.CodeEditor.prototype.setTheme | |
.getOriginal().wrap(function(proceed) { return proceed("monokai"); }); | |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | |
lively.whenLoaded(function() { | |
(function() { | |
$world.get("MenuBar").addStyleClassName("MenuBar"); | |
$world.withAllSubmorphsDo(function(ea) { return ea.applyStyle({cssStylingMode: true, cssStyling: true}); }); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module('users.YOUR-USERNAME.config').requires().toRun(function() { | |
lively.Config.set("useEmacsyKeys", false); | |
module("lively.ide.CodeEditor").runWhenLoaded(function() { | |
ace.config.loadModule(["keybinding", 'ace/keyboard/vim'], function(vim) { | |
lively.Config.codeEditorUserKeySetup = function(editor) { | |
editor.withAceDo(function(ed) { | |
ed.keyBinding.addKeyboardHandler(vim.handler); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function loadUserKeyBindings() { | |
// user key bindings | |
try { | |
var cust = JSON.parse(lively.LocalStorage.get("user-key-bindings")); | |
ace.ext.keys.addKeyCustomizationLayer("user-key-bindings", cust || {}); | |
var h = ace.require("ace/keyboard/keybinding").KeyBinding.prototype["ace.ext.keys.customized"].detect(function(ea) { | |
return ea.layerName === "user-key-bindings"; }) | |
var proto = ace.ext.keys.KeyHandlerForCustomizations.prototype | |
proto.handleKeyboard = proto.handleKeyboard.getOriginal().wrap(function (proceed, data, hashId, keyString, keyCode) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def ^:dynamic *test-subject* nil) | |
(defn subject-fixture [test] | |
(binding [*test-subject* {:foo 23}] | |
(test))) | |
(use-fixtures :each subject-fixture) | |
(deftest my-test | |
(is (= *test-subject* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM dockerfile/nodejs | |
MAINTAINER Robert Krahn <robert.krahn@gmail.com> | |
USER root | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update | |
RUN apt-get install -y \ | |
python-software-properties \ | |
curl wget git \ | |
less manpages manpages-dev \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
and static typing shouldn't go together with an interactive workflow and live programming. | |
On the contrary, static analysis can help interactive tooling a lot. Refactorings, | |
code browsing, dependency analysis that are implemented in main stream dev envs certainly | |
show that. And then there is "Hole-driven development" [1], code synthesis, | |
constraint and satisfiability solvers like [2] that can make programming more | |
declarative and require a powerful underlying meta system. From this | |
perspective Unison is an exciting project indeed. | |
For some reason, however, it seems to me that the Haskell community (apart from | |
Elm) doesn't really seem to be too interested in that topic. There is Don |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; quite useful: | |
;; http://www.aaronbedra.com/emacs.d/ | |
;; basic settings | |
(setq inhibit-splash-screen t | |
initial-scratch-message nil | |
initial-major-mode 'org-mode) | |
(scroll-bar-mode -1) |
OlderNewer