Skip to content

Instantly share code, notes, and snippets.

View santihbc's full-sized avatar
💭
Edpuzzlin'

Santi Herrero santihbc

💭
Edpuzzlin'
View GitHub Profile
@santihbc
santihbc / slim-redux.js
Created February 7, 2016 22:47 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@santihbc
santihbc / reducers.js
Created January 24, 2016 23:33 — forked from gaearon/reducers.js
How I'd do code splitting in Redux (pseudo code, not tested!)
import { combineReducers } from 'redux';
import users from './reducers/users';
import posts from './reducers/posts';
export default function createReducer(asyncReducers) {
return combineReducers({
users,
posts,
...asyncReducers
});
@santihbc
santihbc / rob.go
Created December 25, 2015 02:21 — forked from Jxck/rob.go
gocon 2014
type errWriter struct {
w io.Writer
err error
}
func (e *errWriter) Write(p []byte) {
if e.err != nil {
return
}
_, e.err = e.w.Write(p)
@santihbc
santihbc / redis.config
Last active August 29, 2015 14:27 — forked from yustam/redis.config
Install Redis on Elastic Beanstalk
packages:
yum:
gcc-c++: []
make: []
sources:
/home/ec2-user: http://download.redis.io/releases/redis-2.8.4.tar.gz
commands:
redis_build:
command: make
cwd: /home/ec2-user/redis-2.8.4
@santihbc
santihbc / 01.config
Last active August 29, 2015 14:17 — forked from etiennea/01.config
packages:
yum:
git: []
gcc: []
make: []
openssl-devel: []
ImageMagick: []
option_settings:
- option_name: NODE_ENV
var spawn = require('child_process').spawn,
info = spawn('file', [ process.argv[2] ]);
var infos = [];
info.stdout.setEncoding('utf8');
info.stdout.on('data', function(buf) { infos.push(buf); });
'use strict';
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev
var gulp = require('gulp'),
clean = require('gulp-clean'),
cleanhtml = require('gulp-cleanhtml'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
stripdebug = require('gulp-strip-debug'),
var Marionette = require('backbone.marionette'),
_ = require('underscore'); // return lodash instance
module.exports = Marionette.LayoutView.extend({
initialize: function () {
console.log('Lodash version', _.VERSION);
}
});
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key