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
const express = require('express'); // exporting the createApplication() in lib/express.js that returns a function which returns a function which has attached extra properties | |
const app = express(); //this also returns a function with some extra properties attached | |
const port = process.env.PORT || 3000; // in production server I will set the env variable PORT so it wont be 3000 | |
app.get('/hello', (req, res) => { | |
res.send('Hello world'); // or I can send a JSON file res.json({firstname: 'John', lastname: 'Doe'}) | |
}); //if a request comes in and url =xxx and verb is GET call the callback and passes an express request and response which are node's req and res on steroids | |
/** |
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
var mongoose = require('mongoose'); | |
var repository = function (modelName) { | |
var self = this; | |
self.Model = require('../models/' + modelName); | |
self.FindById = function (id, cb) { | |
self.FindOne({ |
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 | |
$finder = PhpCsFixer\Finder::create() | |
->exclude([ | |
'tests', | |
'storage', | |
'node_modules', | |
'vendor', | |
]) | |
->in(__DIR__) |
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
{ | |
/* | |
Installed extensions: | |
- File Utils | |
- Github Plus Theme | |
- Git Lens | |
- php-cs-fixer | |
- PHP Intelephense | |
- snippet-creator |
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
# ########################################################## | |
# Stuff related to docker development | |
# ########################################################## | |
docker-compose.* | |
# ########################################################## | |
# Application related stuff | |
# ########################################################## |
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
#!/bin/bash | |
# Check if the correct number of arguments is provided | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 /path/to/your/bitbucket/repo https://github.com/yourusername/yournewrepo.git" | |
exit 1 | |
fi | |
# Variables | |
BITBUCKET_REPO_PATH=$1 |
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
#!/bin/bash | |
# This script updates the remote repositories of a local Git repository. | |
# It requires two arguments: the local repository path and the new GitHub URL. | |
# The script navigates to the provided repository path. | |
# If the directory does not exist, it exits with an error message. | |
# It adds a new remote called "github" with the provided GitHub URL. | |
# The current "origin" remote is renamed to "bitbucket". | |
# The "github" remote is then renamed to "origin". | |
# The script fetches all updates from the new origin. |