Skip to content

Instantly share code, notes, and snippets.

Avatar

Aran w3aran

  • Toronto, ON, Canada
View GitHub Profile
@w3aran
w3aran / Dockerfile
Created Jul 26, 2018 — forked from rcbop/Dockerfile
ionic dockerfile and jenkins file for CI
View Dockerfile
FROM node:8-alpine
LABEL MAINTAINER="rcbpeixoto@gmail.com"
ARG NODEJS_VERSION="8"
ARG IONIC_VERSION="3.20.0"
ARG GRADLE_VERSION="3.2"
ARG ANDROID_SDK_VERSION="4333796"
ARG ANDROID_HOME="/opt/android-sdk"
ARG GRADLE_HOME="/opt/gradle"
@w3aran
w3aran / docker-cleanup.groovy
Created Jul 26, 2018 — forked from rcbop/docker-cleanup.groovy
Jenkins pipeline script for Docker cleanup (remove dangling images and exited containers) in a given build agent
View docker-cleanup.groovy
node("${params.BUILD_AGENT}") {
stage('Dangling Containers') {
sh 'docker ps -q -f status=exited | xargs --no-run-if-empty docker rm'
}
stage('Dangling Images') {
sh 'docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi'
}
@w3aran
w3aran / S3-Static-Sites.md
Created Jun 21, 2018 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.
View S3-Static-Sites.md

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

View why_we_dropped_lerna_from_pouchdb.md

Why we dropped Lerna from PouchDB

We dropped Lerna from our monorepo architecture in PouchDB 6.0.0. I got a question about this from @reconbot, so I thought I'd explain our reasoning.

First off, I don't want this post to be read as "Lerna sucks, don't use Lerna." We started out using Lerna, but eventually outgrew it because we wrote our own custom thing. Lerna is still a great idea if you're getting started with monorepos (monorepi?).

Backstory:

@w3aran
w3aran / app.js
Created Nov 29, 2017 — forked from stongo/app.js
Joi validation in a Mongoose model
View app.js
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', function() {
return console.error.bind(console, 'connection error: ');
});
@w3aran
w3aran / LetsEncrypt.md
Created Mar 5, 2017 — forked from davestevens/LetsEncrypt.md
Let’s Encrypt setup for Apache, NGINX & Node.js
View LetsEncrypt.md

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
@w3aran
w3aran / LetsEncrypt.md
Created Mar 5, 2017 — forked from davestevens/LetsEncrypt.md
Let’s Encrypt setup for Apache, NGINX & Node.js
View LetsEncrypt.md

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/2.0.1/fetch.min.js"></script>