Skip to content

Instantly share code, notes, and snippets.

View STRd6's full-sized avatar
🍑
https://whimsy.space

Daniel X Moore STRd6

🍑
https://whimsy.space
View GitHub Profile
@STRd6
STRd6 / implementation.md
Last active August 29, 2015 14:02
Hamlet Implementation

Hamlet Implementation

There are many existing frameworks and libraries in JavaScript that handle data-binding and application abstractions but none of them offer an integrated solution that works with hihger level languages (CoffeeScript, Haml). You could come close with CoffeeScript + hamlc + Knockout or something similar but it would always be a bit of a kludge because they were never designed to work together.

There are three major issues that should be solved in clientside JavaScript applications:

  1. Improved Language (CoffeeScript, or Dart, TypeScript, etc.)
  2. HTML Domain Specific Language (Haml, Jade, Slim, others)
  3. Data-Binding (React, Knockout, others)
@STRd6
STRd6 / recursive-selection.md
Last active October 18, 2019 19:47
Weird Ideas

Recursive Selection

What would a recursive selection tool look like in a pixel editor?

One should be able to draw fractals using it.

Tab = (name, content) ->
name: name
content: content
tabs = [1..3].map (i) ->
Tab "Tab#{i}", "Hello from tab #{i}"
model =
tabs: tabs
activeTab: Observable tabs[0]
Observable.concat = (args...) ->
args = Observable(args)
o = Observable ->
flatten args.map(splat)
o.push = args.push
return o
@STRd6
STRd6 / lollable.js
Created May 16, 2014 04:43
Lollable
var Callable, c,
__slice = [].slice;
Callable = function(invoke) {
var fn;
fn = function() {
var _ref;
return (_ref = fn.invoke).call.apply(_ref, [this].concat(__slice.call(arguments)));
};
fn.invoke = invoke;
@STRd6
STRd6 / mu.sh
Last active August 29, 2015 13:58
Mush templates into JST
#! /bin/bash
cd templates
for file in *.haml; do
hamlet < $file -r "Hamlet" > ${file/.haml}.js
done
for file in *.js; do
echo "(window.JST || (window.JST = {}))['${file/.js}'] = " > tmpfile

Symbol#to_proc is CoffeeScript

A = (name) ->
  (x) ->
    x[name]
items.map A("size")
#! /usr/bin/env coffee
Heyo
console.log "wat"
@STRd6
STRd6 / hello.js
Created February 6, 2014 18:29
Testing eval-ing gists.
alert("hello");
@STRd6
STRd6 / gasoline.md
Created February 1, 2014 20:16
Chainsaw Parables

Gasoline

A man drove to the country seeking to understand the power of gasoline. He asked the chemist, "what is the power of gasoline?"

The chemist told him, "pick up this machete and clear an acre of land."

The man wondered what clearing land with a machete had to do with gasoline but did so anyway. Every day for thirty days he ate breakfast and cleared trees with the machete. At the end of thirty days he again asked the chemist "what is the power of gasoline?"

The chemist told him, "pick up this chainsaw and clear an acre of land."