-
Running a docker image with port mapping -
docker run --init -p 4444:4444 --rm <IMAGE_NAME>
--init
makes it respond to signals like ctrl+c-d
will make it run in detached mode, so for stopping you'll have to dodocker ps
and use the container id.
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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
# VS Code keyboard shortcuts | |
## Jumping between editors, views and terminal | |
* Jump to file explorer - `Cmd + shift + E` | |
* Switch between open editor tabs - `Ctrl` + `tab` or `Ctrl` + `1` or `2` so on | |
* Jump to terminal - `Ctrl + `` | |
* Quick View Selection - `Ctrl + Q` | |
* Jump to global search view - `Cmd + shift + F` | |
* Jump to Debug view - `shift + Cmd + D` |
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
# CREATION | |
## run an image in interactive mode (-it flag), map a folder between host and container (-v flag) and remove the container after stopping and run BASH in the container | |
docker run --rm -it -v ~/<HOST_DIR>:/<CONTAINER_DIR> <IMAGE_NAME> bash | |
## create an image from a container (useful when you make changes to a container and create a new image out of it) | |
docker commit <CONTAINER_NAME> <NEW_IMAGE_NAME> | |
## create an image from scratch. Create a a Dockerfile in a directory and run the following command in that directory | |
docker build -t <NEW_IMAGE_NAME> . |
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
0 info it worked if it ends with ok | |
1 verbose cli [ '/usr/local/Cellar/node/7.7.3/bin/node', | |
1 verbose cli '/usr/local/bin/npm', | |
1 verbose cli 'version', | |
1 verbose cli 'minor' ] | |
2 info using [email protected] | |
3 info using [email protected] | |
4 info git [ 'status', '--porcelain' ] | |
5 info lifecycle @ruf/[email protected]~preversion: @ruf/[email protected] | |
6 silly lifecycle @ruf/[email protected]~preversion: no script for preversion, continuing |
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
defmodule P7 do | |
# public function that calls a private one with accumulator | |
def flatten(list), do: Enum.reverse(do_flatten(list, [])) | |
# base case - empty list | |
defp do_flatten([], result), do: result | |
# next two clauses for list with many elements | |
defp do_flatten([head | tail], result) when is_list(head), do: do_flatten(tail, do_flatten(head, result)) | |
defp do_flatten([head | tail], result), do: do_flatten(tail, [head | result]) | |
end |
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
1. get list of remote tags | |
git ls-remote --tags origin | |
2. get list of local tags | |
git tag | |
3. remove local tag | |
git tag -d <tag name> | |
4. delete remote tag |
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
'use strict'; | |
module.exports = function (grunt) { | |
// load all grunt tasks | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
// configurable paths | |
var yeomanConfig = { | |
app: 'app', | |
dist: 'dist' |
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
//Two new test-cases in locationSpec 'HashbangUrl' suite | |
it('should should not duplicate query params - LocationHashbangUrl', function() { | |
var baseUrl = 'http://www.server.org:1234/?base=param'; | |
url = new LocationHashbangUrl(baseUrl, '#'); | |
url.$$parse(baseUrl); | |
expect(url.absUrl()).toBe(baseUrl); | |
}); | |
it('should not duplicate query params - LocationHtml5Url', function() { | |
var baseUrl = 'http://www.server.org:1234/?base=param'; |
NewerOlder