Skip to content

Instantly share code, notes, and snippets.

View du2x's full-sized avatar

Eduardo Monteiro du2x

View GitHub Profile
@byronfriesen
byronfriesen / aws-linux-2-wordpress.sh
Last active November 2, 2023 19:14
Amazon Linux 2 LTS - Wordpress / PHP-FPM / NGINX / MariaDB / WP-CLI Auto Install
#!/bin/bash
##############################################################
# Set Your System and Wordpress Config Preferences
##############################################################
export SYSTEM_USER=username # User PHP-FPM runs under
# Database
export WP_DB_NAME=wordpress
@kphretiq
kphretiq / Flask-SqlAlchemy-Many-to-Many.py
Last active March 16, 2024 17:18
A (hopefully) simple demo of how to do many-to-many relationships using Flask-SQLAlchemy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from flask import Flask, url_for
from flask_sqlalchemy import SQLAlchemy
"""
Flask-SQLAlchemy many-to-many relationship using helper table
http://flask-sqlalchemy.pocoo.org/2.1/models/
Hippies love their dogs.
@artieziff
artieziff / mongodb.md
Created October 29, 2013 23:46
MongoDb & Python Essentials

##MONGODB & PYTHON

###Ubuntu Install

sudo apt-get install mongodb
pip install pymongo

Table - Collection
Column - Property
Row - Document

@letanure
letanure / estados-cidades.json
Last active April 30, 2024 23:07
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@jpoehls
jpoehls / encoding-helpers.ps1
Created April 17, 2012 14:54
Convert-FileEncoding and Get-FileEncoding
<#
.SYNOPSIS
Converts files to the given encoding.
Matches the include pattern recursively under the given path.
.EXAMPLE
Convert-FileEncoding -Include *.js -Path scripts -Encoding UTF8
#>
function Convert-FileEncoding([string]$Include, [string]$Path, [string]$Encoding='UTF8') {
$count = 0