Entries Categorized under 'Dynamic languages' ↓

Getting started with Gradle

Did you know that there is a Java build system that does not use angle brackets? More and more projects are using Gradle as an integrated part of their development process. In short, Gradle provides a Groovy DSL for declarative builds based on build conventions. This blog post aims to give you a kickstart if you want to start exploring Gradle yourself by introducing some core concepts and commands. Installation If you have not used Gradle before, you must install…

Javascript Conditionals

As we all know, Javascript is a very flexible language. In the article I will show different ways to execute conditional code by using some common idioms from Javascript and general object-oriented techniques. Default values Javascript does not support default values for arguments and it is common to use an if statement or a conditional expression to set default values.

I usually prefer to use an or-expression instead. The short-circuiting or, ||, avoids the repetition of the conditional operator…

Three Undocumented Features of JSON

Update: This article was written as an April Fool’s joke, taking a stab at the fact that JSON is a closed, dumb, and pretty anemic data format. There are other interesting data formats available, such as extensible data notation (edn). JSON (JavaScript Object Notation) is widely known as JavaScript’s data format, often used as a language-independent data interchange format. However, what I consider to be the three most powerful features of JSON are little-known. The main reason for this is…

Get S3 request statistics in four simple steps

Web Workers

Poor man’s two-way binding in Windows 8 (WinJS)

If you’re a web developer with prior experience from MVVM/MV* frameworks like Knockout or Batman going into Windows 8 development, one thing you quickly notice is the lack of two-way binding when using the WinJS template control. In this blog post we´re going to show you a starting point to roll your own two-way binding without going to another lib, when binding a simple view model to a view with a WinJS template. Intro When working with the ListView control…

The Cypher Ruby DSL for the Neo4j Graph Database

This week I released the neo4j-cypher ruby gem version 1.0.0. Cypher queries can now be written in Ruby instead of as a long string. The DSL uses common Ruby conventions and a neo4j.rb influenced API. The neo4j-cypher gem contains adaptors for both the neo4j.rb and neography gems. The DSL supports the cypher language implemented in the 1.8 release of neo4j which just have been released. Introduction to Neo4j and Graph Databases Using a graph database means that you store your…

Good CSS Practices

A Decimal to Roman Numeral converter in just a few lines

Tests in Javascript Metro Applications

Simple AOP in JavaScript

During a recent re-factoring of some JavaScript I accidentally removed the last line of a function that told the UI to re-render according to the new data. After that I figured, why not move this outside of the function and get a little AOP look and feel. The code below gives a simplified version of the problem. Foo.Bar=function(){ var someValue; var self={ foo:function(addThis){ someValue+=addThis; rerender(); //This line have to be here… } }; return self; }(); So with that in mind I created the three obvious methods, before, after and…

Finding Out Who Changed What with Datomic

Neo4j.rb 2.0 – An Overview

Writing a Node Module

This example assumes that you have a Github account. If you don't have one, you can get one at (suprise!) Github. It also assumes that you have installed Node and npm. It will also simplify your life to have the github gem installed Create the basic structure

OK, now I have an initialized repository and I need something to put in it. I like Readme Driven Development and, in that spirit, let's create a Readme.

`sleep-sort` works by…

Simple Google Maps API Example

Braceless Programming

The Fantastic SUBST Function (part 4)

The Fantastic SUBST Function (part 3)

The Fantastic SUBST Function (part 2)

The Fantastic SUBST Function (part 1)

When John McCarthy in 1960 wrote his famous paper on the programming language LISP, he used a particular function to illustrate what you could do with the language. The language consisted of only nine “special forms”, primitive building blocks by which any computable function could be created. The function was called SUBST, and it included all nine of the special forms. It was a remarkable function. It could rip through any tree and replace all leaves that had one value…

How to use user metadata in post types via Advanced Custom Fields in WordPress

Note: This article is unfortunately outdated. Please se this tutorial on how to create your own acvanced custom field types. To get the most out of this article a basic knowledge of PHP, WordPress, custom post types and Advanced Custom Fields is required. If you’ve ever needed custom data input for your WordPress posts or pages (or any other kind of custom post type) then Advanced Custom Fields (ACF) is the shit! It’s flexible, extensible and frequently improved by Elliot…

Capistrano and Net:SSH with login shell