Skip to content

Instantly share code, notes, and snippets.

@thedewpoint
thedewpoint / resize_and_upload_task.js
Created April 24, 2016 20:04
Image manipulation and upload to S3
/**
* Created by daniel on 9/29/2015.
*/
var AWS = require('aws-sdk');
AWS.config.update({accessKeyId: 'ID', secretAccessKey: 'KEY'});
AWS.config.update({region: 'us-east-1'});
var s3 = new AWS.S3();
var fileType = require('file-type');
var lwip = require('lwip');
var uuid = require('node-uuid');
@thedewpoint
thedewpoint / sorting.js
Created January 12, 2021 15:26
different sorting algorithms implemented in JS
const test = [5,6,1,7,7,7,7,3,5,2,2,9,9,0,9];
const insertionSort = (arr)=>{
for(let i = 1; i < arr.length; i++){
let current = arr[i];
let j = i-1;
while(j >=0 && arr[j] > current) {
arr[j+1] = arr[j]
j--;
}
@thedewpoint
thedewpoint / Docker.md
Created June 16, 2021 23:51 — forked from CaryBourgeois/Docker.md
How to set up FaunaDB clusters using the Public Docker image.

How to use the FaunaDB public Docker image.

This document will walk through creating a FaunaDB docker instance using the publicly available docker image. Three different types of deployments will be illustrated.

  • A single node FaunaDB - basic developer functionality.
  • A three node, single replica instance of FaunaDB - scale out operations.
  • A three node, three replicas instance of FaunaDB - distributed operations.

Finally, we will wrap up with some more general documentation around the various options available when using the public docker image.

Requirements

@thedewpoint
thedewpoint / cert-manager.yaml
Created December 16, 2021 00:34
Cert manager for ARM
This file has been truncated, but you can view the full file.
# Copyright 2021 The cert-manager Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@thedewpoint
thedewpoint / argo-ingress.yaml
Created December 16, 2021 00:40
ArgoCD ingress for traefik
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: argo-ui
namespace: argocd
annotations:
kubernetes.io/ingress.class: "traefik"
ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
cert-manager.io/cluster-issuer: letsencrypt-prod
@thedewpoint
thedewpoint / cluster-issuer.yaml
Created December 16, 2021 00:53
Cluster issuer for cert-manager
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
email: your.email@gmail.com
privateKeySecretRef:
name: prod-issuer-account-key
server: https://acme-v02.api.letsencrypt.org/directory
@thedewpoint
thedewpoint / pom.xml
Last active December 16, 2021 01:08
Jib configuration for ARM
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.1.4</version>
<configuration>
<from>
<image>openjdk:11</image>
<platforms>
<platform>
<architecture>amd64</architecture>
@thedewpoint
thedewpoint / .gitlab-ci.yml
Created December 16, 2021 01:15
gitlabs ci for jib image to ecr
cache:
key: mavencache
paths:
- ./.m2/repository
services:
- docker:dind
variables:
# Instruct Testcontainers to use the daemon of DinD.
DOCKER_HOST: "tcp://docker:2375"
@thedewpoint
thedewpoint / .gitlab-ci.yml
Created December 16, 2021 01:19
gitlabs ci config for nodejs arm
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
AWS_ECR: "<ecr-account>.dkr.ecr.us-east-1.amazonaws.com/<repo-name>:<tag>"
DOCKER_REGISTRY: "<ecr-account>.dkr.ecr.us-east-1.amazonaws.com"
DOCKER_HOST: "tcp://docker:2375"
stages:
- buildx
@thedewpoint
thedewpoint / Dockerfile
Created December 16, 2021 01:21
dockerfile for nodejs service
FROM node:16.13.1-alpine AS build-env
COPY . /app
WORKDIR /app
RUN npm ci --only=production
FROM node:16.13.1-alpine
COPY --from=build-env /app /app
WORKDIR /app
CMD ["./bin/www"]