Skip to content

Instantly share code, notes, and snippets.

Avatar
💜
Decentralizing

RangerMauve

💜
Decentralizing
View GitHub Profile
@RangerMauve
RangerMauve / ostrum-lang.md
Created Mar 29, 2016
Ideas for programming language
View ostrum-lang.md

Ostrum

A simple, lisp-like, and functional language for experimenting with making a language.

Variable declarations

Variables are declared on the stack, declaring one can be done with the = function. Variables are marked as being constant upon being assigned, and cannot be reassigned again within the current function. The assignment function takes two arguments, name:String and value:Any. Since it's just a function, you can pass in a variable for the name to have dynamically resolved names within the current scope.

Assigning to a variable example:

@RangerMauve
RangerMauve / mqtt.pegjs
Created Mar 21, 2016
MQTT-Regex parser in PEG.js
View mqtt.pegjs
path = items:(pathStart pathEnd?) {return items[0].concat(items[1])}
pathStart = (items:(pathItem / singleParam / single)+)
pathEnd = item:(multiParam / multi / lastItem) {return item}
pathItem = text:pathName "/" {return {type: "text", content: text}}
lastItem = text:pathName "/"?
@RangerMauve
RangerMauve / example.s
Created Mar 21, 2016
S Expressions in PEG.js
View example.s
(
(
[] 1337 "cats" dogs)
(+ 1 0xFF)
)
View Ideas
conspicor (Behold) -> Observable library
nexilis (Tied) -> Templating library
@RangerMauve
RangerMauve / index.js
Created Apr 29, 2015
requirebin sketch
View index.js
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var Ractive = require("ractive");
var Swipe = require("ractive-swipe-pages");
var ractive = new Ractive({
el: '#container',
template: '#template',
data: {
toggled: true
View gist:3628bed7a25cd79a6394
//https://www.npmjs.com/package/duplexer
var duplexer = require("duplexer");
var through = require("through2");
function boostrap(fn){
var input = noop(); // Just passes data through
var output = noop(); // Just passed data through;
input.once("data",function(chunk, encoding, cb){
View Image URL
https?:\/\/.*\/(.*?).(jpe?g|gif|png)
@RangerMauve
RangerMauve / CSS Quiz.html
Last active Jan 3, 2016
A simple quiz to help gauge the CSS ability of a potential designer.
View CSS Quiz.html
<div class="A">
<div>
Hello, I like <span class="B">cats</span>.
</div>
<div>
I like <span class="B">dogs</span>.
</div>
<div>
I prefer <span class="B">reptiles</span>.
</div>
@RangerMauve
RangerMauve / R.js
Last active Dec 30, 2015
This is a neat idea I had for having variables that act like primitive values but are actually functions. Useful for having complex variables that automagically update.
View R.js
// This calls the function whenever a primitive is needed
function R(fn){
return {
valueOf:fn,
toString:function(){
return fn()+"";
}
};
}
@RangerMauve
RangerMauve / XKCD1288.user.js
Last active Dec 27, 2015
This is a filter I made that makes reading news more fun, I got the idea from http://xkcd.com/1288/. Since it's a userscript it should be easily install-able in Chrome or Firefox. In chrome it's as simple as downloading this file and dragging it into your "extensions" window.
View XKCD1288.user.js
// ==UserScript==
// @name FunNewsSubstitutions
// @namespace http://mauve.us.to
// @description This is a filter I made that makes reading news more fun, I got the idea from http://xkcd.com/1288/. Since it's a userscript it should be easily install-able in Chrome or Firefox
// @include *
// ==/UserScript==
// Wrapper to keep things in their own scope
(function(){