Skip to content

Instantly share code, notes, and snippets.

@mikeshot
mikeshot / 00-README.md
Created September 24, 2019 14:11 — forked from guumaster/00-README.md
How to upload a file with $.ajax to AWS S3 with a pre-signed url

Upload a file with $.ajax to AWS S3 with a pre-signed url

When you read about how to create and consume a pre-signed url on this guide, everything is really easy. You get your Postman and it works like a charm in the first run.

Then you open your browser, try your usual $.ajax() and send your PUT operation, and you hit the cold iced wall of AWS error message, a simple <Code>SignatureDoesNotMatch</Code> that will steal hours from your productivity.

So here I come to save you and give you a free working example of how to upload a file directly to AWS S3 from your browser. You are wellcome :).

@mikeshot
mikeshot / symfony3-rest-api.md
Created March 12, 2018 15:09 — forked from diegonobre/symfony3-rest-api.md
Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 3 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authenticationu
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :

@mikeshot
mikeshot / PHP5 to Oracle database connections
Last active September 28, 2016 04:21
The motherf*cking way the get Oracle access in PHP5 over Ubuntu
# The motherf*cking way the get Oracle database connections in PHP5 over Ubuntu
Special thanks to:
* [AJ ONeal](https://twitter.com/coolaj86)
* [Hsiao Siyuan](http://hsiaosiyuan.com/wp/)
## First step: Install the Oracle Client
1. Download Instant Client from http://www.oracle.com/technetwork/indexes/downloads/index.html#database (you must be registered in Oracle; it's free). You will need `instantclient-basic-*-*.zip` and `instantclient-sdk-*-*.zip` files.