Skip to content

Instantly share code, notes, and snippets.

View mason-stewart's full-sized avatar
🎃
無敵

Mason Stewart mason-stewart

🎃
無敵
  • Bookshop.org
  • NeW eNgLaNd
View GitHub Profile
<html></html>
;; User behaviors
;; -----------------------------
;; Behaviors are stored as a set of diffs that are merged together
;; to create the final set of functionality that makes up Light Table. You can
;; modify these diffs to either add or subtract functionality.
;;
;; Behaviors are added to tags, objects with those tags then automatically gain
;; whatever logic the behavior imparts. To see a list of user-level behaviors,
;; start typing a word related to the functionality you want in between the square
;; brackets (e.g. "theme").
@mason-stewart
mason-stewart / Gruntfile.js
Created January 28, 2014 02:08
Run `npm install --save grunt-cdn`, and then add these bits to Gruntfile.js
grunt.initConfig({
// ...
cdn: {
options: {
/** @required - root URL of your CDN (may contains sub-paths as shown below) */
cdn: 'https://YOUR-USERNAME.github.io/YOUR-REPO/',
/** @optional - if provided both absolute and relative paths will be converted */
flatten: true
/** @optional - if provided will be added to the default supporting types */
// supportedTypes: { 'phtml': 'html' }
@mason-stewart
mason-stewart / asdf.js
Created January 7, 2014 21:29
This will prep your urls to work from a subfolder when deployed to GH pages, but still work locally. You'll also need to run `npm install --save grunt-cdn`.
// add this to your configuration
cdn: {
options: {
cdn: '//YOUR-USERNAME.com/YOUR-REPO-NAME/',
flatten: true
},
dist: {
src: ['./dist/*.html', './dist/styles/{,*/}*{,*/}*.css']
}
}
@mason-stewart
mason-stewart / app.jsx
Last active January 2, 2016 08:09
Using React 0.8.0. This throws an JSX compilation error on line 23 of app.jsx for some reason?
/** @jsx React.DOM */
'use strict';
var data = {
message: 'Dumb Dumb',
text: "green",
color: "green"
}
var HelloWorld = React.createClass({
getInitialState: function() {
(ns test2
"Let's start with something short."
(:require [dommy.core :as dom]
[inky.sketch :as sketch])
(:use-macros [dommy.macros :only (node)]))
(sketch/page-style!
[:div.box {:position "absolute"
:top "48%"
:bottom "48%"
(ns test
"Let's start with something short."
(:require [dommy.core :as dom]
[inky.sketch :as sketch])
(:use-macros [dommy.macros :only (node)]))
(sketch/page-style!
[:div.box {:position "absolute"
:top "48%"
:bottom "48%"
(ns first
"Let's start with something short."
(:require [dommy.core :as dom]
[inky.sketch :as sketch])
(:use-macros [dommy.macros :only (node)]))
(sketch/page-style!
[:div.box {:position "absolute"
:top "48%"
:bottom "48%"
@mason-stewart
mason-stewart / typed.sjs
Created December 21, 2013 17:06
Typed functions in Sweet.js
let function = macro {
rule {
$fn ($($arg ":"$type) (,) ...) $body
} => {
function $fn ($($arg) ...) {
if ($(typeof($arg) == $type &&) ...) {}
$($type) (,)...
}
}
}
@mason-stewart
mason-stewart / wercker.yml
Last active December 25, 2015 11:29
Wercker is a cool continuous integration service that works well with just about any stack, including the ubiquitous Yeoman Webapp. This is the Wercker config file that works with the Yeoman Webapp generator (https://github.com/yeoman/generator-webapp). Drop this in the root of your repo, push it, and add your repo to Wercker at https://app.werc…
# wercker.yml
box: wercker/nodejs
# Build definition
build:
# The steps that will be executed on build
steps:
# A step that executes `npm install` command
- npm-install