Skip to content

Instantly share code, notes, and snippets.

View andresgutgon's full-sized avatar
:octocat:
Coding things...

Andrés andresgutgon

:octocat:
Coding things...
  • Barcelona
View GitHub Profile
# SWAP The fcsonline way
# First make yourself sudo like this
sudo su
# The copy these lines in the console
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
### Keybase proof
I hereby claim:
* I am andresgutgon on github.
* I am andresgutgon (https://keybase.io/andresgutgon) on keybase.
* I have a public key ASCacdfdFvZwrBEN1muWuTNiEETe2c4gzbkUikI07TRL2Qo
To claim this, I am signing this object:
<div style="clear: both;">
<img src="" alt="" style="float: left;margin-right: 10px;"/>
<div></div>
</div>
@andresgutgon
andresgutgon / README.md
Last active December 3, 2016 17:08
Little mocker excercise. Learn what are the different test doubles we can use when we test our code.

Testing: The little mocker

This is an example trying to apply some lessons learned from Uncle Bob's article The little mocker

In this gist first I'll explain what I learned. Then I'll show you what the code does and finally how I tested the code.

What I learned

When we're making unit test we want to focus on the code we want to test not external dependencies that are not under our control. To make life easier and being able to test on isolation our code without side effects from the rest of the world we use test doubles. Test doubles try to simulate behavior that is in our code but belongs to external agents/objects.

<!DOCTYPE html>
<html>
<head></head>
<style>
* {
box-sizing: border-box;
}
body {
font-size: 13px;
}
var _ = require('underscore');
var config = require('./grunt/webpack/config.js');
var plugins = require('./grunt/webpack/plugins.js');
const env = 'development';
var environments = {
production: {
plugins: plugins[env],
devtool: 'source-map',
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
import _ from 'underscore';
import { createSelector } from 'reselect';
function selectMembersWithUser(members, users) {
const entities = _.map(members.byUserID, (member) => {
const userById = users.byID[member.user_id];
const user = _.omit(userById, ['created_at', 'updated_at', 'id']);
return {
...user,
require('babel/register')({
sourceMap: 'inline'
});