by Ossi Hanhinen, @ohanhi
with the support of Futurice 💚.
Licensed under CC BY 4.0.
| #Deploy and rollback on Heroku in staging and production | |
| task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
| task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
| namespace :deploy do | |
| PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
| STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
| task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag] | |
| task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on] |
| // jQuery.support.transition | |
| // to verify that CSS3 transition is supported (or any of its browser-specific implementations) | |
| $.support.transition = (function(){ | |
| var thisBody = document.body || document.documentElement, | |
| thisStyle = thisBody.style, | |
| support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined; | |
| return support; | |
| })(); |
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Resolution independent rendering of Bezier curves in WebGL</title> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| <script src="glMatrix-0.9.6.min.js"></script> | |
| <script id="shader-vs" type="x-shader/x-vertex"> | |
| attribute vec3 aVertexPosition; | |
| attribute vec2 aBezierCoord; |
| module Elmz.Signal where | |
| import Elmz.Maybe | |
| {-| Delay the input `Signal` by one unit. -} | |
| delay : a -> Signal a -> Signal a | |
| delay h s = | |
| let go a {prev,cur} = { cur = prev, prev = a } | |
| in foldp go { prev = h, cur = h } s | |
| |> lift .cur |
| import Color (Color, rgb) | |
| import Graphics.Collage (..) | |
| import Graphics.Element (Element) | |
| import List ((::), map) | |
| import Signal (Signal, foldp, (<~), sampleOn) | |
| import Keyboard (arrows) | |
| import Time (millisecond, every) | |
| -------------------------- |
| parallel : Address a -> List (Task error a) -> Task error (List ThreadID) | |
| parallel address tasks = | |
| let | |
| sendToAddress task = spawn (task `andThen` send address) | |
| in | |
| sequence (List.map sendToAddress tasks) |
| defmodule MyApp do | |
| use Application | |
| def start(_type, _args) do | |
| import Supervisor.Spec, warn: false | |
| children = [ | |
| Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [ | |
| dispatch: dispatch | |
| ]) |
Should be work with 0.18
Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !
myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))| /*! (c) 2016 Andrea Giammarchi - MIT Style License */ | |
| // simple state-like objects handler | |
| // based on prototypal inheritance | |
| function State() {'use strict';} | |
| // States are serializable dictionaries | |
| // toJSON and toString are the only reserved keywords | |
| // every other name can be used as name (included __proto__) |