Better to be slapped with the truth than kissed with a lie. ―Russian Proverb
Are you already nodding in agreement and admiring the wisdom of the words above? Most of you just kissed yourselves with yet another lie.
When asked, we will all confidently proclaim we want to know the truth “even…
The most powerful tsunami footage I have ever seen. Raw, stunning, destruction.
(via wekeroad)
(via ecdesignz)
Background tasks are crucial for any non-trivial web application so it’s no wonder that the landscape of queuing technologies is rapidly evolving.
The latest entry is Octobot, a Java-based task queue worker from C. Scott Andreas designed to be reliable, easy to use, and powerful.
Reliable
Octobot uses best-of-breed tools for queuing, supporting AMQP/RabbitMQ, Beanstalk, and Redis (Pub/Sub) as backends out of the box. The architecture is extensible so additional backends can be added in the future.
Easy to use
Octobot tasks are simply classes with a static
runmethod which accept a JSON object.package com.example.tasks; import org.apache.log4j.Logger; import org.json.simple.JSONObject; public class TacoTask { private static Logger logger = Logger.getLogger("TacoTask"); public static void run(JSONObject task) { String payload = (String) task.get("payload"); logger.info("OMG, GOT A TACO: " + payload"); } }… or in Scala:
package com.example.tasks import org.apache.log4j.Logger import org.json.simple.JSONObject object TacoTask { val log = Logger.getLogger("TacoTask"); def run(task: JSONObject) { val payload = task.get(“payload”) log.info(“OMG, GOT A SCALA TACO: ” + payload) } }Octobot also has a simple YAML-based config file format:
Octobot: queues: - { name: tacotruck, protocol: AMQP, host: localhost, port: 5672, vhost: /, priority: 5, workers: 1, username: cilantro, password: burrito } metrics_port: 1228 email_enabled: false email_from: ohai@example.com email_to: ohno@itsbroke.com email_hostname: localhost email_server: smtp.gmail.com email_port: 465 email_ssl: true email_auth: true email_username: username email_password: passwordPowerful
Octobot is designed for high throughput, heavy workloads, and ultra-low latency. Early benchmarks using AMQP and MongoDB lookups demonstrate, task execution actually improves as the JIT optimizes execution paths.
Frank Sinatra was the Chairman of cool. Some fourteen years after his death, the crooner is still imitated.
Just like its namesake, Sinatra, the class Ruby web application DSL still inspires all sorts of projects from Sammy.js to Padrino to Denied.
Slim, a PHP5 project from Josh Lockhart is the latest project to cover the classics.
Setup
To get started, just require the script and call
init<?php require('slim/Slim.php'); Slim::init(); ?>Routing
Slim supports the familiar Sinatra-style routes for all four HTTP verbs:
Slim::get('/books/:id', function ($id) { //Do something }); Slim::post('/books', function () { //Do something }); Slim::put('/books/:id', function ($id) { //Do something }); Slim::delete('/books/:id', function ($id) { //Do something });Middleware and callbacks
Slim also allows you to run code before and after your actions:
Slim::before(function () { //Do something }); Slim::after(function () { //Do something });Templating
Slim supports a variety of templates including Smarty and Twig.
Even with the improvements @font-face brings to typography, web designers still don’t have quite the control as their print counterparts. Basic tasks like per-letter or per-word styling involves a lot of
<span>’s and stupid markup tricks.Dave Rupert aims to help with Lettering.js, a jQuery plugin for “radical web typography.”
How it works
In this example, Lettering.js takes over the tedious task of creating all of those per-letter
<span>’s:$(document).ready(function() { $(".fancy_title").lettering(); });… which yields
<h1 class="fancy_title"> <span class="char1">S</span> <span class="char2">o</span> <span class="char3">m</span> <span class="char4">e</span> <span class="char5"></span> <span class="char6">T</span> <span class="char7">i</span> <span class="char8">t</span> <span class="char9">l</span> <span class="char10">e</span> </h1>You’re now free to style each individual letter with the resulting CSS classes.
Don’t need that fine-grained control? Lettering.js can handle per-word options as well:
$(document).ready(function() { $(".word_split").lettering('words'); });