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
| // show json as noob | |
| let first_json = { programmer: 'Andre', hair_color: 'Black' } | |
| let secound_json = { programmer: 'Noob guy', hair_color: 'yellow' } | |
| console.log(first_json) | |
| console.log(secound_json) | |
| // show json as a pro: | |
| console.log('%c my jsons', 'color: red; font-weight: bold;') | |
| console.log({ first_json, secound_json }) |
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
| sudo apt-get install freetds-dev | |
| curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - | |
| sudo add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)" | |
| sudo apt-get updatesudo apt-get update | |
| sudo apt-get install -y mssql-server | |
| sudo /opt/mssql/bin/mssql-conf setup | |
| systemctl status mssql-server |
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
| # | |
| # Sets Prezto options. | |
| # | |
| # Authors: | |
| # Sorin Ionescu <[email protected]> | |
| # | |
| # | |
| # General | |
| # |
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 Unit < ApplicationRecord | |
| store :data, accessors: %i[position phone email], coder: JSON | |
| belongs_to :company, inverse_of: :units, optional: true | |
| belongs_to :unit_parent, class_name: "Unit", foreign_key: "unit_id", optional: true | |
| 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
| class Spaceship { | |
| constructor(name, crewQuantity) { | |
| this.name = name, | |
| this.crewQuantity = crewQuantity, | |
| this.velocity = 0 | |
| } | |
| speedUp(acceleration) { | |
| return this.velocity += acceleration | |
| } |
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
| sudo docker run -d \ | |
| --name=mongodb \ | |
| --restart=always \ | |
| -p 27017:27017 \ | |
| mongo:latest |
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
| sudo docker run -d \ | |
| --name=redis \ | |
| --restart=always \ | |
| -v redis:/var/lib/redis/data \ | |
| -p 6379:6379 \ | |
| redis:latest |
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
| #!/bin/sh | |
| sudo su | |
| echo "Installing and Reloading APACHE2" | |
| apt install apache2 | |
| systemctl reload apache2.service | |
| echo "adding the repository and installing php" | |
| add-apt-repository -y ppa:ondrej/php | |
| apt-get update |
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
| # Download and Install R if you need put your current version of https://cran.r-project.org/ | |
| wget https://cran.r-project.org/bin/linux/ubuntu/bionic-cran35/dh-r_20180506~ubuntu18.04.1~ppa1_all.deb | |
| sudo dpkg -i dh-r_20180506_ubuntu18.04.1_ppa1_all.deb | |
| # Install, chaning the name of the package to the one you downloaded - perhaps easiest if you go to your Downloads directory - and you'll probably find that there are missing packages: | |
| sudo dpkg -i rstudio-1.0.124-amd64.deb |
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
| #run jupyter | |
| sudo docker run -d --rm \ | |
| --name=jupyter \ | |
| -p 8888:8888 \ | |
| -e JUPYTER_LAB_ENABLE=yes \ | |
| -v "${PWD}":/home/jovyan/work \ | |
| jupyter/datascience-notebook | |
| #catch the token | |
| sudo docker exec -it jupyter jupyter notebook list |