This file contains hidden or 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
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
function render(model) { | |
return h('article', h('.title', { | |
onblur: function(e) { | |
model.title = e.target.innerText.replace(/\n/g, ""); | |
e.target.innerHTML = '<h1>' + model.title + '</h1>'; | |
}, | |
attributes: { contenteditable: true }}, |
This file contains hidden or 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
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var pogo = require('pogo'); | |
var code = "h 'h1' 'Edit me'"; | |
function render(model) { | |
return h('div', | |
h('textarea', { | |
style: textAreaStyle, | |
binding: [model, 'code'], |
This file contains hidden or 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
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var pogo = require('pogo'); | |
var code = "h 'h1' 'Edit me'"; | |
function render(model) { | |
return h('div', | |
h('textarea#read', { | |
style: textAreaStyle, | |
binding: [model, 'code'], |
This file contains hidden or 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
// a little pogo/plastiq REPL | |
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var pogo = require('pogo'); | |
var example = "h 'h1' 'Edit me!'"; | |
function render(model) { | |
return h('div', | |
h('textarea', { style: textAreaStyle, binding: [model, 'code'] }), |
This file contains hidden or 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
# ruby resize.rb <path-to-hi-res-icon> | |
[29,40,58,76,80,87,120,156,180].each do |n| | |
`convert "#{ARGV[0]}" -resize #{n}x#{n} "#{n}.png"` | |
end |
This file contains hidden or 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
var plastiq = require('plastiq'); | |
var h = plastiq.html; | |
var bind = plastiq.bind; | |
function render(model) { | |
return h('div', | |
h('input', | |
{ | |
type: 'file', | |
model: function (file) { |
This file contains hidden or 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
var code = ['item = 0', 'do', ' print (item)', ' item := item + 1', 'while @{ item < 10 }'] | |
try { | |
var js = require('pogo').compile(code.join("\n"), { inScope: false }) | |
document.body.innerHTML += js; | |
} catch (e) { | |
document.body.innerHTML += e.toString(); | |
} |
This file contains hidden or 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
var cssToXPath = require('css-to-xpath'); | |
document.body.innerHTML = cssToXPath('p:not(:has(a.x))'); |
This file contains hidden or 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
mkdir beefy-test | |
cd beefy-test | |
npm init | |
npm install pogo watchify pogoify cssify beefy -save | |
echo "* { color: red }" > index.css | |
echo "require './index.css'" > index.pogo | |
echo "document.body.innerHTML = 'Featurist FTW'" >> index.pogo | |
beefy index.pogo -- -t pogoify -t cssify |
This file contains hidden or 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
var code = '[w <- ["happy", "days"], w].join " "' | |
var js = require('pogo').compile(code, { inScope: false }) | |
document.body.innerHTML += eval(js); |