A 2x2 grid layout with cells expanding/collapsing on click.
A Pen by Aurelien Giraud on CodePen.
const myMachine = Machine({ | |
id: "slide", | |
initial: "notFlying", | |
on: { | |
FLY: "flying" | |
}, | |
states: { | |
flying: { | |
on: { | |
LAND: "notFlying.hist" |
const myMachine = Machine({ | |
initial: 'slide', | |
states: { | |
slide: { | |
id: 'slide', | |
initial: 'ground', | |
states: { | |
ground: { | |
on: { | |
CLIMB_UP: 'ladder' |
const myMachine = Machine({ | |
id: 'slide', | |
initial: 'ground', | |
states: { | |
ground: { | |
on: { | |
CLIMB_UP: 'ladder' | |
} | |
}, | |
ladder: { |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
+------------------------+ | |
| | +------------------------+ | |
| +--------------------+ | | | | |
| | | | | +--------------------+ | | |
| | laptop-config.rb | | 1. Fetch | | | | | |
| | +------------<---------+ chef-fetch-run.sh | | | |
| +------------------|-+ | | | | | | |
| | | | +--------------------+ | | |
| | | | | | |
| +------------>--------> 2. Run Chef recipe | |
# update the apt cache | |
apt_update 'Update the apt cache daily' do | |
frequency 86_400 | |
action :periodic | |
end | |
# Make sure some packages are present | |
package ['ruby-shadow', 'whois', 'vim', 'git', 'geogebra', 'vlc', 'browser-plugin-vlc', 'libavcodec-extra', 'chromium-browser', 'chromium-browser-l10n', 'chromium-codecs-ffmpeg'] | |
# Make sure there is a user called Stephen |
// GET a goal. | |
// (Accessed at GET http://localhost:8080/goals/goal_id) | |
app.get('/goals/:id', function(req, res) { | |
var goal_id = req.params.id; | |
db.findOne({ | |
_id: goal_id | |
}, {}, function(err, goal) { | |
if (err) res.send(err); | |
res.json(goal); | |
}); |
A 2x2 grid layout with cells expanding/collapsing on click.
A Pen by Aurelien Giraud on CodePen.
This script builds a bootstrap carousel from the images on a page whose 'alt' attribute starts with a given keyword .
If there is also one 'feature image' on the page, it will become the first image in the carousel.
(I wrote this script for a template for the Ghost blogging platform because there seemed to be no way to accomplish this server-side.)
A Pen by Aurelien Giraud on CodePen.