Skip to content

Instantly share code, notes, and snippets.

View xJuggl3r's full-sized avatar

xJuggl3r

View GitHub Profile
@xJuggl3r
xJuggl3r / json_to_csv.py
Last active April 2, 2023 14:44
JSON to CSV - Convert JSON from current folder and subfolders to csv. Also deletes JSON
import json
import csv
import os
# current directory
path = os.getcwd()
# Converts all JSON files in a folder and its subfolders to CSV files
def convert_all_json_to_csv():
for root, _, files in os.walk(path):
@xJuggl3r
xJuggl3r / nginx-before.conf
Created June 9, 2021 19:41
nginx-before.conf
server {
listen 80;
listen [::]:80;
server_name safetechnology.com.br www.safetechnology.com.br;
index index.php index.html index.htm;
root /var/www/html;
@xJuggl3r
xJuggl3r / docker-compose-before.yml
Created June 9, 2021 19:36
docker-compose-before.yml
version: '3'
services:
db:
image: mysql:8.0
container_name: db
restart: unless-stopped
env_file: .env
environment:
- MYSQL_DATABASE=wordpress
@xJuggl3r
xJuggl3r / docker-compose.yml
Last active June 9, 2021 19:16
docker-compose.yml
version: '3'
services:
db:
image: mysql:8.0
container_name: db
restart: unless-stopped
env_file: .env
environment:
- MYSQL_DATABASE=wordpress
@xJuggl3r
xJuggl3r / nginx.conf
Last active June 9, 2021 19:09
ngix.conf
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
@xJuggl3r
xJuggl3r / cloud-init-docker.sh
Last active June 6, 2021 20:44
Cloud-init script with Docker
#! /bin/bash
sudo setenforce 0
#sudo apt update
# Install Docker
#curl -fsSL https://get.docker.com -o get-docker.sh
#sh get-docker.sh
# Or install Docker rootless
cat <<EOF | sudo sh -x
@xJuggl3r
xJuggl3r / CS1101 - LJ8
Created October 26, 2019 21:16
CS1101 - Learning Journal 8
# # Converting my LJ7 dict to txt file
pt2fr = {'um': 'un', 'dois': 'deux', 'três': 'trois', 'quatro': 'quatre'}
# using utf-8 due to accented character in pt-br
f = open("pt2fr.txt", encoding='utf-8', mode='w+')
f.write(str(pt2fr))
f.close()
# getting content to file and storing in a var
with open("pt2fr.txt", encoding='utf-8', mode='r') as file_content:
@xJuggl3r
xJuggl3r / DOMContentLoaded.js
Created May 31, 2019 17:24
DOMContentLoaded
document.addEventListener('DOMContentLoaded', (event) => {
//the DOM is ready, we can do what we want!
})