#!/bin/sh
# https://docs.docker.com/engine/installation/linux/ubuntu/#install-using-the-repository
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88 | grep [email protected] || exit 1
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
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 flask import Flask | |
from flask_caching import Cache | |
import random | |
app = Flask(__name__) | |
cache = Cache(app, config={'CACHE_TYPE': 'redis', 'CACHE_REDIS_URL': 'redis://localhost:6379/0'}) | |
@app.route("/route1") | |
@cache.cached(timeout=10) | |
def route1(): |
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 flask import Blueprint | |
from flask import Flask | |
app = Flask(__name__) | |
v1 = Blueprint("version1", "version1") | |
v2 = Blueprint('version2', "version2") | |
Scripts to run specific services
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 inspect | |
from jsonschema import ( | |
validate, | |
exceptions as jsonschema_exceptions | |
) | |
from django.core import exceptions | |
from django.contrib.postgres.fields import JSONField | |
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
# -*- coding: utf-8 -*- | |
# import pandas and numpy package | |
import numpy as np | |
import pandas as pd | |
# List unique values in a DataFrame column | |
df['Column Name'].unique() | |
# To extract a specific column (subset the dataframe), you can use [ ] (brackets) or attribute notation. |
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
# conditional update | |
# boto3, an AWS SDK package | |
# JSON, a text format package that is language independent | |
# decimal, a precision Handling package | |
import boto3 | |
# this looks after validation error (throws a statement if the entity already exists) | |
from botocore.exceptions import ClientError |
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
GET /hotes_properties/_search | |
{ | |
"size": 10, | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"match": { | |
"published": true |
See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)
For the sake of "maintaining the tradition" here is the updated version.