Skip to content

Instantly share code, notes, and snippets.

View MEGApixel23's full-sized avatar
🌴

Igor Omelchenko MEGApixel23

🌴
View GitHub Profile
@MEGApixel23
MEGApixel23 / S3-Static-Sites.md
Created January 2, 2020 14:31 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

@MEGApixel23
MEGApixel23 / dynamodb_replicate_table.py
Created December 16, 2019 10:40 — forked from Dineshkarthik/dynamodb_replicate_table.py
Copy dynamoDB table to another region using python, boto3. This script creates an exact replica of the table with same key schema and attribute definitions.
# Copyright (C) 2018 Dineshkarthik Raveendran
from __future__ import print_function # Python 2/3 compatibility
import boto3
import argparse
def replicate(table_name, existing_region, new_region, new_table_name):
"""
Replicate table in new region.
@MEGApixel23
MEGApixel23 / stream-file-upload-s3-nodejs.js
Created January 8, 2019 08:26 — forked from schempy/stream-file-upload-s3-nodejs.js
Streaming File Uploads To Amazon S3 With Node.js
var http = require('http');
var router = require('routes')();
var Busboy = require('busboy');
var AWS = require('aws-sdk');
var inspect = require('util').inspect;
var port = 5000;
// Define s3-upload-stream with S3 credentials.
var s3Stream = require('s3-upload-stream')(new AWS.S3({
accessKeyId: '',
@MEGApixel23
MEGApixel23 / README.md
Created October 25, 2016 09:53 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@MEGApixel23
MEGApixel23 / Remove From Git By Extension
Created October 11, 2016 08:30 — forked from benzittlau/Remove From Git By Extension
Remove all *.swp files from a git repository
git ls-files | grep '\.swp$' | xargs git rm
@MEGApixel23
MEGApixel23 / git-rename-branch
Last active August 23, 2018 10:06 — forked from lttlrck/gist:9628955
Rename git branch locally and remotely
#!/bin/bash
if [ -z "$1" ]
then
echo "Specify old branch"
fi
if [ -z "$2" ]
then
echo "Specify new branch"