Skip to content

Instantly share code, notes, and snippets.

View mikamboo's full-sized avatar
🏠
Working from home

Michaël P.O. mikamboo

🏠
Working from home
View GitHub Profile
@mikamboo
mikamboo / .gitlab-ci.yml
Created January 29, 2021 09:09 — forked from angeloreale/.gitlab-ci.yml
Dockerizing a Node.js and MongoDB app with CI/CD Pipelines on Gitlab for staging and production environments.
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
STAGE_CONTAINER: dev
PROD_CONTAINER: prod
DEV_FOLDER: /path/to/repo/dev
PROD_FOLDER: /path/to/repo/prod
@JamieCurnow
JamieCurnow / firestore.ts
Created December 8, 2020 13:33
Using Firestore with Typescript - no examples
/**
* This Gist is part of a medium article - read here:
* https://jamiecurnow.medium.com/using-firestore-with-typescript-65bd2a602945
*/
// import firstore (obviously)
import { firestore } from "firebase-admin"
// Import or define your types
// import { YourType } from '~/@types'
@wilsonkhlam
wilsonkhlam / Vagrantfile
Created September 25, 2019 16:18
Provision Single Master, Multi-nodes Kubernetes Cluster with Vagrant
IMAGE_NAME = "bento/ubuntu-16.04"
N = 2
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
version: '3'
services:
master:
build:
context: .
dockerfile: ./master.Dockerfile
working_dir: /root/playbooks
volumes:
- /c/repos/ansible/playbooks:/root/playbooks
- /c/repos/ansible/config:/etc/ansible
@steimntz
steimntz / create_user_for_namespace.sh
Last active February 13, 2024 14:24
Script to create user with permission for a specific namespace.
#!/bin/bash
# In honor of the remarkable Windson
#/bin/bash
namespace=$1
if [[ -z "$namespace" ]]; then
echo "Use "$(basename "$0")" NAMESPACE";
exit 1;
fi
@angeloreale
angeloreale / .gitlab-ci.yml
Last active January 17, 2023 10:10
Dockerizing a Node.js and MongoDB app with CI/CD Pipelines on Gitlab for staging and production environments.
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
STAGE_CONTAINER: dev
PROD_CONTAINER: prod
DEV_FOLDER: /path/to/repo/dev
PROD_FOLDER: /path/to/repo/prod
@alexanmtz
alexanmtz / auth.js
Last active April 5, 2021 15:32
Routes on front-end using react router
class Auth {
/**
* Authenticate a user. Save a token string in Local Storage
*
* @param {string} token
*/
/* eslint-disable no-undef */
static authenticateUser (token) {
localStorage.setItem('token', token)
}
@superseb
superseb / expose-udp-nginxingress-rancher2-custom.md
Last active October 31, 2023 10:46
Expose UDP service via NGINX ingress controller on Rancher 2 custom cluster
@christianlacerda
christianlacerda / firestore-field-filter.ts
Last active April 28, 2023 05:18
Filters Firestore events based on field name and event type
import * as admin from 'firebase-admin';
import { Change, EventContext } from 'firebase-functions';
import { isEqual } from 'lodash';
import DocumentSnapshot = admin.firestore.DocumentSnapshot;
import FieldPath = admin.firestore.FieldPath;
const isEquivalent = (before: any, after: any) => {
return before && typeof before.isEqual === 'function'
? before.isEqual(after)
@andrewstuart
andrewstuart / .gitlab-ci.yml
Last active June 12, 2023 17:44
One Deployment Per branch, plus CI CD, gitlab and helm setup
image: docker.mydomain.com/build/kube-go-make
variables:
DOCKER_TAG: docker.mydomain.com/myapp/home:$CI_COMMIT_REF_SLUG
DOCKER_HOST: tcp://localhost:2375
DOCKER_DRIVER: overlay
PROD_RSYNC_HOST: myprodserver.com
DOMAIN: mydomain.com
CHART_DIR: chart