Skip to content

Instantly share code, notes, and snippets.

View jgololicic's full-sized avatar

Jernej jgololicic

View GitHub Profile
@jgololicic
jgololicic / gist:7ef0712d840ea3e3a41ec0ca5ec0d18c
Last active July 22, 2018 17:25
Angular CLI generate component in non-standard Angular project directory structure

Angular CLI generate component in non-standard Angular project directory structure

If you have Angular project with non-standard directory structure, for example:

server
    js
    models
    ...
client
@jgololicic
jgololicic / ts
Created June 18, 2018 10:55
Promise vs Observable
Single value (Promise) vs multiple values (observable)
-------------------------------------------------------
const numberPromise = new Promise((resolve) => {
resolve(5);
resolve(10);
});
numberPromise.then(value => console.log(value));
@jgololicic
jgololicic / multicast-public-share-refcount.md
Last active January 12, 2018 11:35
RxJs - Multicast, Public, Share, RefCount
@jgololicic
jgololicic / user.ts
Last active April 14, 2024 03:38
Mongoose, Typescript, Pre hook, hash password, compare passwords
import * as mongoose from 'mongoose';
import {Schema} from 'mongoose';
const bcrypt = require('bcrypt-nodejs');
const userSchema = new Schema({
local: {
username: String,
email: {type: String, unique: true, index: true, sparse: true, lowercase: true, trim: true},
password: String,