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
| config.vm.provision "ansible" do |ansible| | |
| ansible.playbook = "devops/provisioning/playbook.yml" | |
| 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
| eval $(cat .env | sed 's/^/export /') |
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
| FROM node:latest | |
| WORKDIR /opt | |
| RUN apt-get update | |
| RUN apt-get install -y libzmq3-dev | |
| RUN npm install -g zmq | |
| VOLUME /opt | |
| EXPOSE 8688 |
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
| function remove_files() { | |
| echo '│ ├─ remove files docker/System/'$1$2 | |
| rm -rf 'docker/System/'$1$2 | |
| } | |
| function copy_files() { | |
| echo '│ ├─ copy App/'$1$3 '-> docker/System/'$2 | |
| cp -r 'App/'$1$3 'docker/System/'$2 | |
| } | |
| echo ' ______' |
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
| applications: | |
| - buildpack: staticfile_buildpack | |
| disk_quota: 128M | |
| memory: 128M | |
| name: MyAwesomeAppFrontEnd | |
| path: webapp | |
| routes: | |
| - route: my-awesome-app.io |
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
| import pandas as pd | |
| def load(): | |
| df = pd.read_csv('/home/toubi/Titanic.csv', delimiter=';') | |
| return df | |
| def compute_max_ticket_price_per_class(df): | |
| return { cl: df[cl == df.Class]['Ticket price'].max() for cl in range(1, 4) } |
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
| import cProfile | |
| cProfile.run('run()') |
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
| 4145 function calls (4134 primitive calls) in 0.008 seconds | |
| Ordered by: standard name | |
| ncalls tottime percall cumtime percall filename:lineno(function) | |
| 6 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:402(parent) | |
| 51 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:989(_handle_fromlist) | |
| 1 0.000 0.000 0.007 0.007 <ipython-input-1-0a0672299ac8>:11(run) | |
| 1 0.000 0.000 0.006 0.006 <ipython-input-1-0a0672299ac8>:3(load) | |
| 1 0.000 0.000 0.001 0.001 <ipython-input-1-0a0672299ac8>:8(normalize_ticket_price_per_class) |
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
| 8347 function calls (8300 primitive calls) in 0.012 seconds | |
| Ordered by: standard name | |
| ncalls tottime percall cumtime percall filename:lineno(function) | |
| 6 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:402(parent) | |
| 55 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:989(_handle_fromlist) | |
| 1 0.000 0.000 0.005 0.005 <ipython-input-119-9a494182bfd0>:11(normalize_ticket_price_per_class) | |
| 1309 0.000 0.000 0.000 0.000 <ipython-input-119-9a494182bfd0>:13(<lambda>) | |
| 1 0.000 0.000 0.011 0.011 <ipython-input-119-9a494182bfd0>:15(run) |
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
| from time import time | |
| from functools import wraps | |
| def simple_time_tracker(log_fun): | |
| def _simple_time_tracker(fn): | |
| @wraps(fn) | |
| def wrapped_fn(*args, **kwargs): | |
| start_time = time() | |
| try: |
OlderNewer