The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
| - postgreSQL database example. just create action limit to 5 heroku clear db testing | |
| - form object Money Gem or | |
| - Presenter object, geokit and googlemaps | |
| - Flash, flash now | |
| - Error Handling | |
| - views | |
| - sass scut pure | |
| - Crud two - heroku -datetime category form for | |
| - Mailer | |
| - Service objects |
| gist |
| class Fixnum | |
| alias_method :times, :* | |
| def *(o=nil) | |
| o.nil? ? ->(x){ times x } : times(o) | |
| end | |
| end | |
| puts (11..14).map(&3.*) |
| <script> | |
| var i = 0 | |
| var deviceOrientationData | |
| window.addEventListener('deviceorientation', function( event ) { | |
| deviceOrientationData = event; | |
| i = i + 1 | |
| }, false); | |
| function AddCount() { |
| class CreatePost | |
| # An interactor to create a post. | |
| # Initialize with a request object that implements the request interface for this interactor. | |
| def initialize(request) | |
| RequestInterface.required_on! request | |
| @user = {:title => request.title} | |
| end | |
| def result |
| # Using the erlang mechanism of tuple modules it is possible to create a "stateful module". | |
| # This concept of a stateful module is discussed in "Programming erlang" Second edition. | |
| defmodule User do | |
| defstruct name: nil, admin: false, internal: "kinda private" | |
| def new(name, options \\ []) do | |
| dependencies = struct(%__MODULE__{name: name}, options) | |
| {__MODULE__, dependencies} |
| # This module represents a behaviour and when used picks from the Application configuration which implementation will be used | |
| defmodule Clock do | |
| @callback now() :: Integer.t | |
| defmacro __using__([]) do | |
| module = Application.get_env(:my_app, :Clock) | |
| quote do | |
| alias unquote(module), as: Clock | |
| end |
| // Turns out this was not too difficult. | |
| // By using the event loop as a global mail box ordering is even guaranteed for messages between only two actors. | |
| // TODO would like to try and put one actor in a web worker to get some real parallism | |
| // TODO would like to handle errors and have the concept of a deceased actor while a reference to an actor still exists. Probably involves creating an actor system like in Scala. Eurgh. | |
| var actor = { | |
| send: function(message) { | |
| var self = this; | |
| console.log("sending to:", self); | |
| setTimeout(function(){ |
| pub mod raxx { | |
| #[derive(Debug)] | |
| pub enum Method {GET, POST} | |
| #[derive(Debug)] | |
| pub struct Request { | |
| pub method: Method | |
| } | |
| #[derive(Debug, PartialEq)] | |
| pub struct Response { |