- Steps to install Python 3.x and Django 1.9 on Mac OS X El Capitan (10.11.2) - and use virtualenv and virtualenvwrapper - for a development environment set up locally with the intention of subsequent deployment to Heroku or Digital Ocean or Google App Engine.
- Finishing with adding PostgreSQL later (http://johndturner.me/setting-up-a-new-mac-for-pythondjango-development-os-x-el-capitan/), installed using Homebrew for local development.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var elixir = require('laravel-elixir'); | |
/* | |
|-------------------------------------------------------------------------- | |
| Elixir Asset Management | |
|-------------------------------------------------------------------------- | |
| | |
| Elixir provides a clean, fluent API for defining some basic Gulp tasks | |
| for your Laravel application. By default, we are compiling the Sass | |
| file for our application, as well as publishing vendor resources. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PureComponent } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Async } from 'react-select'; | |
// UI. | |
import { withStyles } from 'material-ui/styles'; | |
import { FormControl } from 'material-ui/Form'; | |
import { InputLabel } from 'material-ui/Input'; | |
Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.
As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:
- publish
- request
- start/stop subscription
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env jest */ | |
import _ from 'lodash' | |
import path from 'path' | |
import fs from 'fs' | |
import callsites from 'callsites' | |
import knex from 'knex' | |
import hash from 'object-hash' | |
import conf from '<conf>' | |
// Get the db config. |
Install Babun http://babun.github.io/
Install Hyper http://hyper.is/
Download Fira Code font https://github.com/tonsky/FiraCode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const records = await eventColl | |
.aggregate([ | |
{ | |
$match: { | |
company_id, | |
soft_delete: false, | |
}, | |
}, | |
{ | |
$sort: sortObj, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:10.15.3-alpine | |
WORKDIR /opt | |
ENV PORT=8000 | |
ENV HOST=localhost | |
ENV NODE_ENV=development | |
ENV RABBIT_URL=amqp://rabbit:rabbit@localhost/comspaces | |
ENV POSTGRES_URL=postgres://postgres:secret@localhost:5432/user-service | |
ENV MONGO_URL=mongodb://mongodb-host:27017/user-service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:10.15.3-alpine | |
WORKDIR /opt | |
ENV NODE_ENV=development | |
ENV HOST=localhost | |
ENV PORT=8000 | |
ENV MONGO_URL=mongodb://localhost:27017/sample-service | |
ENV RABBIT_URL=amqp://rabbit:rabbit@rabbitmq:5672/example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
* It was requested to be introduced at as part of the jsonwebtoken library, | |
* since we feel it does not add too much value but it will add code to mantain | |
* we won't include it. | |
* | |
* I create this gist just to help those who want to auto-refresh JWTs. | |
*/ | |
const jwt = require('jsonwebtoken'); |
OlderNewer