Skip to content

Instantly share code, notes, and snippets.

Avatar

Johnny Mejias datajohnny

View GitHub Profile
View newsletter.json
{
"campaign": {
"name": "May Newsletter",
"templateSettings": {
"context": {
"context": {
"rid": "%%emailaddr%%",
"custom": {
"header": "",
"footer": "",
@datajohnny
datajohnny / rmcc.md
Created Sep 20, 2017 — forked from devinus/rmcc.md
Rebelmail Code Challenge
View rmcc.md

Rebelmail Code Challenge

Minimize an HTML page with inline CSS using whatever novel techniques you can think of without affecting the presentation of the document.

Write a microservice to consume the HTML, save an email document to a database with the original and transformed versions of the document, and send the transformed result in an HTML email to a specified recipient.

@datajohnny
datajohnny / checkout.js
Created Sep 11, 2017
Example moongoose model
View checkout.js
const mongoose = require('mongoose');
const { decrypt, encrypt } = require('../utils/crypto');
const { Schema } = mongoose;
const CheckoutSchema = mongoose.Schema({
userId: Schema.Types.ObjectId,
customerId: Schema.Types.ObjectId,
status: { type: String, enum: ['queued', 'sent', 'recovered'] },
provider: String,
View cases.csv
selector iframe value result
#some #iframe black black
#some #iframe yellow yellow
#some #iframe red red
#some #iframe violet violet
#some #iframe green green
View checkout.js
import { extendObservable } from 'mobx';
import { setDefaultModelSchema, list, object, primitive } from 'serializr';
import { defaults } from 'lodash';
import Address from './Address';
import Customer from './Customer';
import Order from './Order';
class Checkout {
constructor(obj) {
const checkout = defaults({
View core.clj
(ns ruler.core
(:gen-class)
(:require [clara.rules :refer :all]
[clara.tools.inspect :refer :all]))
(defrecord Person [name age])
(defrule is-adult
[Person (>= 21 age)]
=>
View gist:fdd5fb7fe7331c629962
FROM msaraiva/elixir-dev
RUN apk --update add make gcc bash vim git-bash-completion && \
rm -rf /var/cache/apk/*
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN mix do deps.get, compile
View gist:c6ea4cae862b720b9c36
== Compilation error on file lib/comeonin/bcrypt.ex ==
** (MatchError) no match of right hand side value: {:error, :on_load_failure}
(stdlib) erl_eval.erl:669: :erl_eval.do_apply/6
17:04:22.407 [error] Process #PID<0.131.0> raised an exception
** (MatchError) no match of right hand side value: {:error, {:load_failed, 'Failed to load NIF library: \'Error loading shared library /usr/src/app/_build/dev/lib/comeonin/priv/bcrypt_nif.so: Exec format error\''}}
lib/comeonin/bcrypt.ex:45: Comeonin.Bcrypt.init/0
(kernel) code_server.erl:1674: anonymous fn/1 in :code_server.handle_on_load/4
could not compile dependency :comeonin, "mix compile" failed. You can recompile this dependency with "mix deps.compile comeonin", update it with "mix deps.update comeonin" or clean it with "mix deps.clean comeonin"
View gist:60cddc7850b81607090b
FROM ubuntu:14.04
MAINTAINER Johnny Mejias <jmejias17@gmail.com>
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update -q && \
apt-get -y install curl locales && \
locale-gen "en_US.UTF-8" && \
export LANG=en_US.UTF-8 && \
curl -o /tmp/erlang.deb http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && \
View gist:5ea386548ce90fa4696a
== Compilation error on file lib/comeonin/bcrypt.ex ==
** (MatchError) no match of right hand side value: {:error, :on_load_failure}
(stdlib) erl_eval.erl:669: :erl_eval.do_apply/6
02:49:35.142 [error] Process #PID<0.386.0> raised an exception
** (MatchError) no match of right hand side value: {:error, {:load_failed, 'Failed to load NIF library: \'/usr/src/app/_build/dev/lib/comeonin/priv/bcrypt_nif.so: invalid ELF header\''}}
lib/comeonin/bcrypt.ex:45: Comeonin.Bcrypt.init/0
(kernel) code_server.erl:1674: anonymous fn/1 in :code_server.handle_on_load/4
could not compile dependency :comeonin, "mix compile" failed. You can recompile this dependency with "mix deps.compile comeonin", update it with "mix deps.update comeonin" or clean it with "mix deps.clean comeonin"