Tutorial by Examples: er

docker run -p "8080:8080" myApp docker run -p "192.168.1.12:80:80" nginx docker run -P myApp In order to use ports on the host have been exposed in an image (via the EXPOSE Dockerfile directive, or --expose command line option for docker run), those ports need to be bound to...
During a merge, you can pass --ours or --theirs to git checkout to take all changes for a file from one side or the other of a merge. $ git checkout --ours -- file1.txt # Use our version of file1, delete all their changes $ git checkout --theirs -- file2.txt # Use their version of file2, delete ...
$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2bc9b1988080 redis "docker-entrypoint.sh" 2 weeks ago Up 2 hours 0.0.0.0:6379->6379/tcp eleph...
Docker commands which take the name of a container accept three different forms: TypeExampleFull UUID9cc69f11a0f76073e87f25cb6eaf0e079fbfbd1bc47c063bcd25ed3722a8cc4aShort UUID9cc69f11a0f7Nameberserk_wozniak Use docker ps to view these values for the containers on your system. The UUID is generat...
To stop a running container: docker stop <container> [<container>...] This will send the main process in the container a SIGTERM, followed by a SIGKILL if it doesn't stop within the grace period. The name of each container is printed as it stops. To start a container which is stoppe...
Ordinarily, images are pulled automatically from Docker Hub. Docker will attempt to pull any image from Docker Hub that doesn't already exist on the Docker host. For example, using docker run ubuntu when the ubuntu image is not already on the Docker host will cause Docker to initiate a pull of the l...
Docker commands which take the name of an image accept four different forms: TypeExampleShort ID693bce725149Namehello-world (defaults to :latest tag)Name+taghello-world:latestDigesthello-world@sha256:e52be8ffeeb1f374f440893189cd32f44cb166650e7ab185fa7735b7dc48d619 Note: You can only refer to an im...
A ViewPager allows to show multiple fragments in an activity that can be navigated by either fliping left or right. A ViewPager needs to be feed of either Views or Fragments by using a PagerAdapter. There are however two more specific implementations that you will find most useful in case of using ...
A TabLayout can be used for easier navigation. You can set the tabs for each fragment in your adapter by using TabLayout.newTab() method but there is another more convenient and easier method for this task which is TabLayout.setupWithViewPager(). This method will sync by creating and removing tabs...
SQL TermsMongoDB TermsDatabaseDatabaseTableCollectionEntity / RowDocumentColumnKey / FieldTable JoinEmbedded DocumentsPrimary KeyPrimary Key (Default key _id provided by mongodb itself)
WiredTiger supports LSM trees to store indexes. LSM trees are faster for write operations when you need to write huge workloads of random inserts. In WiredTiger, there is no in-place updates. If you need to update an element of a document, a new document will be inserted while the old document will...
jQuery.ajax({ url: 'https://api.dropboxapi.com/2/users/get_current_account', type: 'POST', headers: { "Authorization": "Bearer <ACCESS_TOKEN>" }, success: function (data) { console.log(data); }, error: function (error) { ...
We use Notification.requestPermission to ask the user if he/she wants to receive notifications from our website. Notification.requestPermission(function() { if (Notification.permission === 'granted') { // user approved. // use of new Notification(...) syntax will now be succe...
It's an emulation of classical inheritance using prototypical inheritance which shows how powerful prototypes are. It was made to make the language more attractive to programmers coming from other languages. 6 IMPORTANT NOTE: Since ES6 it doesn't make sense to use pseudo-calssical inheritance sinc...
5 It allows us to define a property in an existing object using a property descriptor. var obj = { }; Object.defineProperty(obj, 'foo', { value: 'foo' }); console.log(obj.foo); Console output foo Object.defineProperty can be called with the following options: Object.definePropert...
5 Using property descriptors we can make a property read only, and any attempt to change it's value will fail silently, the value will not be changed and no error will be thrown. The writable property in a property descriptor indicates whether that property can be changed or not. var a = { }; ...
5 We can avoid a property from showing up in for (... in ...) loops The enumerable property of the property descriptor tells whether that property will be enumerated while looping through the object's properties. var obj = { }; Object.defineProperty(obj, "foo", { value: 'show', enu...
5 A property's descriptor can be locked so no changes can be made to it. It will still be possible to use the property normally, assigning and retrieving the value from it, but any attempt to redefine it will throw an exception. The configurable property of the property descriptor is used to dis...
5 Treat a property as a combination of two functions, one to get the value from it, and another one to set the value in it. The get property of the property descriptor is a function that will be called to retrieve the value from the property. The set property is also a function, it will be call...
This query will return the number of tables in the specified database. USE YourDatabaseName SELECT COUNT(*) from INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' Following is another way this can be done for all user tables with SQL Server 2008+. The reference is here. SELECT COUNT(...

Page 29 of 417