Skip to content

Instantly share code, notes, and snippets.

View sany2k8's full-sized avatar
:octocat:
Focusing

Md. Sany Ahmed sany2k8

:octocat:
Focusing
  • Khulna, Bangladesh
View GitHub Profile
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active March 13, 2025 18:08
To install Github Desktop for Ubuntu

IMPORTANT

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.

@leongjinqwen
leongjinqwen / upload-to-aws-flask.md
Created January 23, 2020 15:32
upload files to aws s3 bucket with flask

Upload files to AWS

Make sure you already have S3 bucket, access key and secret key before go through this notes.

How to connect to AWS?

Boto3 allows Python developers to write software that makes use of services like Amazon S3 and Amazon EC2.

Step 1: Install boto3 with pip

pip install boto3
GET /hotes_properties/_search
{
"size": 10,
"query": {
"bool": {
"must": [
{
"match": {
"published": true
@pictolearn
pictolearn / update_an_item_conditionally.py
Last active June 27, 2022 00:03
conditional update in a DynamoDB table using python
# 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
@sany2k8
sany2k8 / useful_pandas_snippets.py
Last active December 29, 2018 16:32 — forked from fomightez/useful_pandas_snippets.py
Useful Pandas Snippets
# -*- 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.
import inspect
from jsonschema import (
validate,
exceptions as jsonschema_exceptions
)
from django.core import exceptions
from django.contrib.postgres.fields import JSONField
@GabrielCzar
GabrielCzar / DOCKER_COMPOSE.md
Last active March 16, 2024 21:42
Docker compose samples

Scripts to run specific services

@berend
berend / versioning.py
Last active August 27, 2023 21:45
Versioning with flask blueprint
from flask import Blueprint
from flask import Flask
app = Flask(__name__)
v1 = Blueprint("version1", "version1")
v2 = Blueprint('version2', "version2")
@sany2k8
sany2k8 / install-docker-ubuntu.md
Last active September 12, 2019 12:10 — forked from subfuzion/install-docker-ubuntu.md
Installing Docker on Ubuntu

Installing with apt-get

#!/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
@ruanbekker
ruanbekker / flask_cache_redis.py
Created May 12, 2018 21:07
Flask-Cache Example with Redis
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():