Skip to content

Instantly share code, notes, and snippets.

@mustafaileri
mustafaileri / serverless.py
Created April 24, 2020 20:30
sample serverless app with ffmpeg and python
import json
import os
import boto3
def lambda_handler(event, context):
try:
s3 = boto3.client('s3')
"""Downlod video from private S3"""
s3.download_file('serverless-test-2020', 'Big_Buck_Bunny_1080_10s_1MB.mp4', '/tmp/test-video.mp4')
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active June 29, 2025 15:18
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