Skip to content

Instantly share code, notes, and snippets.

View angeloreale's full-sized avatar
🌱
const change = time^2

Angelo Reale angeloreale

🌱
const change = time^2
View GitHub Profile
<template lang="pug">
.tictactoe
.board
.row(v-for="(row, y) in currentMatrix", :key="y")
button.cell(v-for="(cell, x) in row", :key="x", :position="x, y", @click="userPlays(x,y)", :disabled="end || currentMatrix[y][x] !== 0")="{{setIcon(x,y)}}"
.status="{{status}}"
button(v-if="end" @click="rebootGame")="Reboot"
</template>
<script>
@angeloreale
angeloreale / certbot-autorenewal.sh
Last active August 17, 2019 05:03
Dockerizing Certbot and automatically renewing Let’s Encrypt certificates with Shell Script and Crontab
### certbot-autorenewal.sh
#!/bin/bash
cd /home/{your-docker-compose-folder}
echo "--------------- RENEWING CERTS ---------------"
docker-compose up certbot-site1.com
docker-compose up certbot-site2.com
etc...
echo "--------------- RESTARTING NGINX ---------------"
service nginx restart
@angeloreale
angeloreale / 004-snippets.sh
Last active July 4, 2023 03:09
Integrating Weechat IRC client with Facebook via Bitlbee, Freenode and Gitter using a VPS and Tmux.
# Integrating Weechat IRC client with Facebook via Bitlbee, Freenode and Gitter using a VPS and Tmux.
# Installing Weechat and Bitlbee.
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 11E9DE8848F2B65222AA75B8D1820DB22A11534E
$ sudo apt-get install apt-transport-https
$ echo "deb https://weechat.org/ubuntu bionic main" | sudo tee /etc/apt/sources.list.d/weechat.list
$ echo "deb-src https://weechat.org/ubuntu bionic main" | sudo tee -a /etc/apt/sources.list.d/weechat.list
$ echo "deb http://download.opensuse.org/repositories/home:/jgeboski/xUbuntu_18.04 ./" | sudo tee -a /etc/apt/sources.list.d/weechat.list
$ echo "deb http://code.bitlbee.org/debian/master/bionic/amd64/ ./" | sudo tee -a /etc/apt/sources.list.d/weechat.list
@angeloreale
angeloreale / daemon.service
Last active February 9, 2019 17:24
Dockerizing a Node.js and MongoDB app with CI/CD Pipelines on Gitlab for staging and production environments.
# /etc/systemd/system/yournodeservice.service
[Unit]
Description=Docker Compose Application Service
Requires=docker.service
After=docker.service
[Service]
Type=simple
RemainAfterExit=yes
@angeloreale
angeloreale / .gitlab-ci.yml
Last active January 17, 2023 10:10
Dockerizing a Node.js and MongoDB app with CI/CD Pipelines on Gitlab for staging and production environments.
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
STAGE_CONTAINER: dev
PROD_CONTAINER: prod
DEV_FOLDER: /path/to/repo/dev
PROD_FOLDER: /path/to/repo/prod
@angeloreale
angeloreale / docker-compose.yml
Last active February 9, 2019 17:48
Dockerizing a Node.js and MongoDB app with CI/CD Pipelines on Gitlab for staging and production environments.
version: '3'
services:
local:
restart: always
container_name: local
volumes:
- ./config-dev.js:/app/config.js
- .:/app
build: .
@angeloreale
angeloreale / Dockerfile
Created February 4, 2019 01:59
Dockerizing a Node.js and MongoDB app with CI/CD Pipelines on Gitlab for staging and production environments.
# Use an official Node runtime as a parent image
FROM node:latest
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in package.json as well as PM2 to ensure the app integrity.
@angeloreale
angeloreale / tse-candidatesxgoods-script.py
Created October 7, 2018 23:36
Using Python and a few other Data Mining technologies, I was able to assess a few meaningful indicators related to the wealth and other characteristics of the electoral candidates in Brazil for 2018.
#!/usr/bin/env python
# coding: utf-8
# In[2] importing libs:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats