- http-requests.
- mocked json-data.
- tricks to manage api.
- handlers, dispatchers etc.
This file contains hidden or 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 mainContainer = $("#main"); | |
var loader = $(".load-bar"); | |
mainContainer.imagesLoaded() | |
.always( function( instance ) { | |
console.log('all images loaded'); | |
toggleElements(); | |
}) | |
.done( function( instance ) { | |
console.log('all images successfully loaded'); |
This file contains hidden or 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
class User { | |
public name: string; | |
public age: number; | |
public languages: string[]; | |
constructor(name:string); | |
constructor(name:string, age?: number); | |
constructor(name:string, age: number, languages?: string[]) | |
constructor(name?:string, age?: number, languages?: string[]) { |
This file contains hidden or 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
MongoClient.connect('mongodb://admin:pass@localhost:27017/mydb?authSource=admin').then((db) => { | |
return db.command({ | |
grantRolesToUser: 'user', | |
roles: ['dbAdmin', 'readWrite'] | |
}) | |
.then((stat) => { | |
console.log(stat); | |
}); | |
}) | |
.catch(console.log); |
This file contains hidden or 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
CREATE DATABASE IF NOT EXISTS mydb; | |
use mydb; |
OlderNewer