GitLab recently decided to silently delete any repositories that hadn't been accessed in the last year. The announcement didn't go over well and they soon caved to public pressure and decided to instead back up inactive repos to object storage instead of unilaterally deleting them. I'm glad they reconsidered, but the experience left me with a bad taste in my mouth, so I decided to look into (relatively) low
This will guide you through setting up a replica set in a docker environment using.
- Docker Compose
- MongoDB Replica Sets
- Mongoose
- Mongoose Transactions
Thanks to https://gist.github.com/asoorm for helping with their docker-compose file!
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
# pull the official mongo docker container | |
docker pull mongo | |
# create network | |
docker network create my-mongo-cluster | |
# create mongos | |
docker run -d --net my-mongo-cluster -p 27017:27017 --name mongo1 mongo mongod --replSet my-mongo-set --port 27017 | |
docker run -d --net my-mongo-cluster -p 27018:27018 --name mongo2 mongo mongod --replSet my-mongo-set --port 27018 | |
docker run -d --net my-mongo-cluster -p 27019:27019 --name mongo3 mongo mongod --replSet my-mongo-set --port 27019 |
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
// jQuery import | |
global.jQuery = require('jquery'); | |
var $ = global.jQuery; | |
window.$ = $; | |
// Bootstrap 4 depends on Popper.js | |
// Popper.js import | |
//import Popper from 'popper.js'; | |
//window.Popper = Popper; |
- Create a
webpack.mix.js
file in root directory:
const { mix } = require('laravel-mix');
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');
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
Installing Laravel 5.2 on Ubuntu 16.04 and Apache2 | |
This post will document how I installed Laravel 5.2, on Apache2 on an Ubuntu 16.04 server. Will will also install MySQL, as we will need a database, and PHP which is required by Laravel. This will be the starting point of most of my posts, so if you’re following along from scratch…this is “scratch!” | |
First thing you need, of course, is the Ubuntu 16.04 server, with an SSH connection. Follow these excellent instructions and get yourself sorted out with one. Make sure you also give the server a static IP address (step 8., in the linked instructions). Come back when you’re done. | |
… | |
Welcome back! Lets get started. |
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
<?php | |
namespace App\Providers; | |
use Blade; | |
use Illuminate\Support\ServiceProvider; | |
use App\Repositories\StoreRepositoryInterface; | |
class BladeServiceProvider extends ServiceProvider | |
{ |
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
// Be careful when changing Object's prototype to avoid overwriting of methods | |
if (Object.prototype.setPath === undefined && Object.prototype.getPath === undefined) { | |
Object.prototype.setPath = function (path, value, notation) { | |
function isObject(obj) { return (Object.prototype.toString.call(obj) === '[object Object]' && !!obj);} | |
notation = notation || '.'; | |
path.split(notation).reduce(function (prev, cur, idx, arr) { | |
var isLast = (idx === arr.length - 1); | |
// if <cur> is last part of path | |
if (isLast) return (prev[cur] = value); |
NewerOlder