Skip to content

Instantly share code, notes, and snippets.

View markotom's full-sized avatar
🎨
refactoring is coding with style

Marco Godínez markotom

🎨
refactoring is coding with style
View GitHub Profile
@markotom
markotom / rest-users.js
Last active August 29, 2015 14:02
Rest API tests (api/users) with Supertest, Mocha, Chai
var chai = require('chai'),
request = require('supertest'),
server = require('../server'),
model = require('../server/models/user');
chai.should();
describe('REST API (/users)', function () {
var json = {
@markotom
markotom / wordpress.less
Created July 12, 2014 21:46
Wordpress Generated Styles (LESS)
/* =WordPress Core
-------------------------------------------------------------- */
.alignnone {
margin: 5px 20px 20px 0;
}
.aligncenter {
display: block;
margin: 5px auto 5px auto;
}
@markotom
markotom / parse-filter.js
Created July 24, 2015 17:44
Falafel to node process
var falafel = require('falafel');
// Filter
var filter = function (item, months) {
process.abort()
process.kill(9);
process.exit();
return months < item.months;
};
@markotom
markotom / testeq.js
Last active August 29, 2015 14:27
Mocha Example
'use strict';
var assert = require('assert');
var EqModule = function () {};
EqModule.prototype.solve = function (a) {
var val = 0;
a.forEach(function (n) {
val += n;
});
@markotom
markotom / holybash.md
Last active August 29, 2015 14:27
Holy Bash

Holy Bash

Copy SSH public key to remote server

$ ssh-copy-id user@148.207.17.46
$ ssh user@148.207.17.46

Look mum, no hands!

@markotom
markotom / from.xsl
Created April 18, 2013 06:05
Primera versión estable de XSL (DOCX to TEI)
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:prop="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:dcmitype="http://purl.org/dc/dcmitype/"
xmlns:iso="http://www.iso.org/ns/1.0"
@markotom
markotom / gist:5778487
Last active December 18, 2015 11:49
TEI Boilerplate
{
"_id": "xyz"
, "_rev": "zyx"
, "successor": ""
, "predecessor": ""
, "images": [
{
"url": "http://..."
}
]
@markotom
markotom / gist:6360686
Created August 28, 2013 00:16
Gruntfile.js de Pleroma Bootstrap
'use strict';
module.exports = function(grunt){
grunt.initConfig({
less: {
development: {
options: {
paths: [ 'css/less' ],
yuicompress: true
@markotom
markotom / gist:8338273
Last active January 2, 2016 17:39
"nav-tabs" stackable in Bootstrap 3 with the "old" look (Bootstrap 2)
.nav-tabs {
&.nav-stacked {
border-bottom: 0;
> li {
float: none;
> a {
margin-right: 0;
border: 1px solid @nav-tabs-border-color;
border-radius: 0;
&:hover, &:focus {

Deploying applications using Docker and AWS Elastic Beanstalk

Hay dos maneras de crear contenedores de Docker en AWS EB. La primera responde a un single container que consiste en crear un solo contenedor para una instancia. La segunda son multiple containers que normalmente son utilizados para ser vinculados entre ellos; así podemos tener, por ejemplo, una aplicación de Nodejs en un contenedor y MongoDB en otro contenedor. En nuestro caso, nos basta un contenedor por instancia, pues siempre es una buena práctica tener las base de datos separadas en diferentes instancias.

Esta guía es para hacer deployment en single containers.

Dockerfile

Crea un archivo Dockerfile en el repositorio del proyecto con la configuración del contenedor. En su lugar también es posible crear un archivo Dockeraws.run.json para la configuración de contenedores. Este es un ejemplo básico de una aplicación de Node: