Skip to content

Instantly share code, notes, and snippets.

View iraklisg's full-sized avatar

iraklisg iraklisg

  • Athens, Greece
View GitHub Profile
@iraklisg
iraklisg / .dockerignore
Last active June 6, 2019 12:10
Dockerize Laravel
# ##########################################################
# Stuff related to docker development
# ##########################################################
docker-compose.*
# ##########################################################
# Application related stuff
# ##########################################################
@iraklisg
iraklisg / settings.json
Last active January 23, 2019 10:56
VSCode user settings
{
/*
Installed extensions:
- File Utils
- Github Plus Theme
- Git Lens
- php-cs-fixer
- PHP Intelephense
- snippet-creator
@iraklisg
iraklisg / .php_cs
Created January 22, 2019 12:54
php-cs-fixer configuration file
<?php
$finder = PhpCsFixer\Finder::create()
->exclude([
'tests',
'storage',
'node_modules',
'vendor',
])
->in(__DIR__)
@iraklisg
iraklisg / repository.js
Created August 10, 2017 09:15 — forked from SerhiiKozachenko/repository.js
Mongoose odm and repository pattern.
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 July 20, 2017 15:03
express mini docs
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
/**