Skip to content

Instantly share code, notes, and snippets.

@rksm
rksm / install-all.sh
Last active June 13, 2016 08:07
lively.modules dev install
#!/bin/bash
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# 1. Install packages
if [[ ! -d lively-loader ]]; then
git clone -b master https://github.com/LivelyKernel/node-lively-loader lively-loader
pushd lively-loader;
npm install;
popd
var exec = require("child_process").exec;
var path = require("path");
var fs = require('fs');
var util = require("util");
var enabled = false;
var sslDir = path.join(process.env.HOME, "lively-web.org/http/ssl/");
var outDir = path.join(sslDir, "lively-web-CA");
var registerCertScript = path.join(sslDir, "register-cert.sh");
@rksm
rksm / stuff.sh
Created July 24, 2015 02:00
install cloxp newest version
wget https://github.com/cloxp/cloxp-install/releases/download/pre-0.0.8/cloxp-pre-0.0.8.zip
unzip cloxp-pre-0.0.8.zip
./install.sh
cd LivelyKernel
sed -i '' 's|+refs/tags/cloxp-pre-0.0.8:refs/tags/cloxp-pre-0.0.8|+refs/heads/*:refs/remotes/origin/*|' .git/config
git fetch origin clojure-support
git checkout clojure-support
npm update
cd ..;
./start.sh
@rksm
rksm / init.el
Last active August 29, 2015 14:22
windows emacs config
;; 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)
@rksm
rksm / gist:69b05f5f25e5078343e3
Last active August 29, 2015 14:21
Twitter message restrictions are annoying...
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
@rksm
rksm / Dockerfile
Created April 14, 2015 21:50
docker setup for clojure / cloxp
FROM dockerfile/nodejs
MAINTAINER Robert Krahn <[email protected]>
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 \
@rksm
rksm / gist:4a6c0116b32046290af3
Last active August 29, 2015 14:17
testing with dynamically bound vars
(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*
@rksm
rksm / gist:cb1317196a1b58b9162f
Created February 17, 2015 08:32
bind keys at runtime fix
(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) {
@rksm
rksm / gist:3318c4431a234815ee4f
Created February 11, 2015 23:54
cloxp enable vim
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);
@rksm
rksm / user config
Last active August 29, 2015 14:15
cloxp dark theme
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}); });