Skip to content

Instantly share code, notes, and snippets.

View yoanisgil's full-sized avatar

Yoanis Gil Delgado yoanisgil

View GitHub Profile
import math
values = [
dict(gni_ppp=7480, life_expectancy=79.6, education_index=0.768,country='CUBA', material_footprint=8.04, co2_emissions=3.42),
dict(gni_ppp=21000, life_expectancy=79.6, education_index=0.768,country='CUBA', material_footprint=8.04, co2_emissions=3.42),
dict(gni_ppp=14086, life_expectancy=79.6, education_index=0.713,country='COSTA RICA', material_footprint=8.08, co2_emissions=2.66),
dict(gni_ppp=53741, life_expectancy=79.2, education_index=0.9,country='US', material_footprint=32.36, co2_emissions=18.35),
dict(gni_ppp=38146, life_expectancy=81.4, education_index=0.911,country='UNITED KINGDOM', material_footprint=22.57, co2_emissions=10.08),
]
@yoanisgil
yoanisgil / bumpme
Last active April 5, 2018 18:18
concourse-tutorial
Thu Apr 5 18:19:52 UTC 2018
Instruction Comments
image: easygeoip_app Name of the docker image after build
build: . Instruct docker compose to build the image with the Dockerfile under the current directory
command: ["python", "/srv/app/main.py"] Change the default command so that the application can be restarted whenever the source code is updated
volumes Mount the current directory at /srv/app in the application's container. This is very handy, since an update to the source code won''t require rebuilding the Docker Image (and hence restarting the application container)
ports Map port 5000 on the container to port 5000on the host. default all Flask's application use port 5000 the web server port so we're just making sure that it's accessible.
environment Here were passing the environment variables required by the application. DEBUG=1 it's very important since Flask will restart the application whenever the source code is updated.
app:
image: easygeoip_app
build: .
command: ["python", "/srv/app/main.py"]
volumes:
- .:/srv/app
ports:
- "5000:5000"
environment:
- DB_PASSWORD=thepassword
FROM python:2.7-slim
MAINTAINER Yoanis Gil<gil.yoanis@gmail.com>
# Create the directory where we will copy the application code
RUN mkdir /srv/app
# ... and declare it as the default working directory
WORKDIR /srv/app
# Add Nginx repository so that we install a recent version
ADD ./docker/nginx.list /etc/apt/sources.list.d/nginx.list
@yoanisgil
yoanisgil / wait_for_port.py
Created February 27, 2017 16:26
Wait for port
#!/usr/bin/env python
import os
import sys
import time
import telnetlib
check_timeout = int(os.environ.get('CHECK_TIMEOUT', 1))
sleep_interval = int(os.environ.get('SLEEP_INTERVAL', 1))
port_to_check = int(os.environ.get('PORT_TO_CHECK'))
@yoanisgil
yoanisgil / LoadAssets.cs
Created September 18, 2016 00:58
Load Assets
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
public class AssetsBundleLoader : MonoBehaviour {
public GameObject prefabButton;
public RectTransform parentPanel;
private string url = "http://localhost:8080/tents";
@yoanisgil
yoanisgil / docker-compose.yml
Last active January 23, 2021 13:55
Rancher SSL with compose
version: '2'
services:
rancher:
image: rancher/server
container_name: rancher-server
restart: always
nginx:
image: nginx:1.11
volumes:
odoo:
image: odoo:9
ports:
- "8069:8069/tcp"
links:
- "db:db"
db:
image: postgres:9
environment:
- POSTGRES_USER=odoo
@yoanisgil
yoanisgil / docker-compose.yml
Last active October 1, 2018 12:10
Elastic Search - Docker Compose
master:
image: elasticsearch:2
ports:
- "9200:9200"
restart: always
container_name: es_master
es-node:
image: elasticsearch:2
command: elasticsearch --discovery.zen.ping.unicast.hosts=es_master