VIM for mouse and user friendly UI editors users.

VIM is verbose and hard to understand, at least for me. First thing you have to know is that by default when you open a file you will be in COMMAND mode which is used to do tricks.

Open a file

vi myFile

Modes

Command (default)

Make commands with some

Posted on
Tagged in vim , editor , unix

Hack: Domain Tools script to highlight short new TLDs (2014)

With the new TLDs out there is hard to find a short one between all that mess. Normally you can find a suitable new TLD at DomainTools but you might want to filter out the ones with a long TLD. This script will fade off longer TLDs.

How to do

Posted on
Tagged in hack , domain-tools , domains

Get position (x, y) from a index in a Ulam spiral in JavaScript

Currently I'm working on a new game and I need to generate the planets. It's a 2D map that is made of blocks, each block has many planets.

Here is an example of the Ulam spiral:

The only difference is that mine starts at 0.

What do I need? Based

Posted on
Tagged in ulam , spiral , javascript

How to integrate Yeoman and Require.js in 2014 (last version)

Update 10/06/2014: Yeoman has changed some little stuff so every instance of <%= yeoman.app %> should be replaced with <%= config.app %>, if you are using the last version. (Thanks to jorge from pointing out in the comments). I will include both versions in this guide

Posted on

How to use CSS (SCSS or SASS) color variables correctly

scss colors

Note: In this post I use camelCase for some variables, but you should use the dash-case in order to be standard.

After developing some websites that requires CSS you might feel a need for variables for colors. In this guide I will use the SCSS/Compass syntax.

Organization

First of

Posted on
Tagged in scss css variables colors sass

React.js: an interactive tutorial to get started

Realy simple and friendly way to learn React.js framework. Quick, concise and interactive.

Render something

React.renderComponent(
    new React.DOM.div({}, 'something'), 
    document.body
);

This just creates a <div> tag in your body like this:

<body>
    <div>something</div>
</body
Posted on
Tagged in react.js

How to add social buttons like FaceBook and Twitter to React.js

You might know that is not so straightforward to include social buttons with React js.

How to add the Twitter's follow button

In order to add it you have to add a iframe directly, which is more compatible with React js. This will act like a normal iframe and will

Posted on

React js: correctly handling state that depends on the props

If you have been used React js for some time you might found a quite an edge case: getting state from the props. This is an anti-pattern in most of the cases. Is not an anti-pattern when the state gets the initial value from the props.

Problem

var render = function
Posted on

How to know when the user tweeted (with custom button)

Sometimes you just want to include your own tweet or rewteet button instead of the one provided by Twitter.

Don't believe me? Test it right now:

We will not be using any

Posted on