Skip to content

Instantly share code, notes, and snippets.

Avatar

iraklisg iraklisg

View GitHub Profile
@iraklisg
iraklisg / .dockerignore
Last active Jun 6, 2019
Dockerize Laravel
View .dockerignore
# ##########################################################
# Stuff related to docker development
# ##########################################################
docker-compose.*
# ##########################################################
# Application related stuff
# ##########################################################
@iraklisg
iraklisg / settings.json
Last active Jan 23, 2019
VSCode user settings
View settings.json
{
/*
Installed extensions:
- File Utils
- Github Plus Theme
- Git Lens
- php-cs-fixer
- PHP Intelephense
- snippet-creator
@iraklisg
iraklisg / .php_cs
Created Jan 22, 2019
php-cs-fixer configuration file
View .php_cs
<?php
$finder = PhpCsFixer\Finder::create()
->exclude([
'tests',
'storage',
'node_modules',
'vendor',
])
->in(__DIR__)
@iraklisg
iraklisg / repository.js
Created Aug 10, 2017 — forked from SergeyKozachenko/repository.js
Mongoose odm and repository pattern.
View repository.js
var mongoose = require('mongoose');
var repository = function (modelName) {
var self = this;
self.Model = require('../models/' + modelName);
self.FindById = function (id, cb) {
self.FindOne({
@iraklisg
iraklisg / expressalicea.js
Last active Jul 20, 2017
express mini docs
View expressalicea.js
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
/**