Skip to content

Instantly share code, notes, and snippets.

View w3aran's full-sized avatar

Aran w3aran

  • Toronto, ON, Canada
View GitHub Profile
@w3aran
w3aran / Dockerfile
Created July 26, 2018 02:35 — forked from rcbop/Dockerfile
ionic dockerfile and jenkins file for CI
FROM node:8-alpine
LABEL MAINTAINER="[email protected]"
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 July 26, 2018 02:33 — forked from rcbop/docker-cleanup.groovy
Jenkins pipeline script for Docker cleanup (remove dangling images and exited containers) in a given build agent
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 June 21, 2018 16:06 — 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.

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

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 November 29, 2017 19:42 — forked from stongo/app.js
Joi validation in a Mongoose model
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 March 5, 2017 14:49 — forked from davestevens/LetsEncrypt.md
Let’s Encrypt setup for Apache, NGINX & Node.js

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 March 5, 2017 14:49 — forked from davestevens/LetsEncrypt.md
Let’s Encrypt setup for Apache, NGINX & Node.js

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 / index.html
Created January 19, 2017 03:32 — forked from anonymous/index.html
JS Bin // source https://jsbin.com/nuneled
<!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>
@w3aran
w3aran / esnextbin.md
Created November 30, 2016 04:55
esnextbin sketch
@w3aran
w3aran / esnextbin.md
Created October 9, 2016 19:29
esnextbin sketch