Env variables inside Ember's index.html

Using environment variables in ember is straightforward: export your env vars using any tool like direnv and import them inside your config/environment.js using node’s process.ENV.YOUR_ENV_KEY.

  ENV.APP.MIXPANEL_TOKEN = process.env.MIXPANEL_TOKEN;
  ENV.APP.GA_TOKEN = process.env.GA_TOKEN;

Then in any part of your Ember app you can import the config env and use them.

import Config from 'my-ember-project/config/environment';

However this won’t work if you want to use an environment variable...

An alternative to eval

When we define a closure in Ruby (a proc or a lambda), it encapsulates its lexical scope/environment.

This means that even if you define a proc in point A in code, if you pass it around and call it in point B, it will still be able to reference variables and anything that is defined inside the lexical scope of point A (where it was defined). To put it in another way, it has “(en)closed its environment”.

What if we would like to do the opposite. Say we define a proc in point A, that if we call...

Hello from Hugo

Hello from Hugo! I had tried Ghost for a while but eventually I abandonded it.. it’s funny because after leaving Jekyll for Ghost I thought I would never come back to static sites generators, yet here I am again.

I have to admit that although Ghost seemed promising, its development was way too slow, plus many breaking changes: they announced 1.0.0 edition about a month ago, it’s still under very heavy development, many many things change (no breaking changes though), mostly visually and stable...

Securing the Sinatra Micro-Framework

Sinatra is an amazing micro-framework that enables you ti build anything from scratch. Of course it does not have Rails’ helpers but it does not contain any magic either, in contrast to Rails. Once you get familiar with it you can build a web app. It is mostly used as a tool for creating web services, RESTful APIs or simple web apps.

Although so simple and powerful, Sinatra needs to be secured in order to push your app into production. Here we will talk about securing Cookies, Sessions and avoiding...

The delusion of OpenID

Have you tired of remembering the combination of username/password for each website that you are registered? Do you hate of creating a new account for each new social web application that comes up to surface? Well OpenID claims that it is the solution to these problems and many more! Without going to detail, OpendID is an open standard that allows you to authenticate to any site that supports it without actually having to sign up for the website. Instead, you authenticate yourself as a user of...

Decentralizing the Centralized Social Internet

If you look around you (in the Internet that is) you will se a huge explosion of social networks. It makes sense actually: humans are social creatures. The thing is that these social networks are so much fragmented that most people try to keep up either with the most known or the ones that are really fond of.

Personally I hate when things are build with such limitations. I believe that it is either lack of imagination or money. Even my blog, I wanted it to be platform agnostic so I can move to...


Page 2 of 2 ← newer posts