Skip to content

Instantly share code, notes, and snippets.

View paivaric's full-sized avatar

Ricardo Paiva paivaric

View GitHub Profile
@paivaric
paivaric / cors.inc
Created December 13, 2018 20:34 — forked from antonbabenko/cors.inc
(nginx AND varnish) + CORS (working example)
more_set_headers "Access-Control-Allow-Origin: $http_origin";
more_set_headers "Access-Control-Allow-Credentials: true";
# OPTIONS indicates a CORS pre-flight request
if ($request_method = 'OPTIONS') {
more_set_headers "Access-Control-Max-Age: 1728000";
more_set_headers "Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, OPTIONS";
more_set_headers "Access-Control-Allow-Headers: Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since";
more_set_headers "Content-Length: 0";
@paivaric
paivaric / parser-server-node-js-mailgun-via-request-api.js
Last active December 3, 2018 19:14 — forked from neguse11/node-js-mailgun-via-api.js
Call Mailgun API from node.js with Request and Parse-Server
// node.js : Mailgun via API
var request = require('request')
Parse.Cloud.define("sendemail", function(req, res) {
var apiBaseUrl = 'https://api.mailgun.net/v3/YOUR_DOMAIN_NAME'; // REPLACE THIS BY YOUR DOMAIN NAME
var apiKey = 'key-YOUR_API_KEY'; // REPLACE THIS BY YOUR API KEY
var from = 'Excited User';
var to = 'example@example.com';
var subject = 'Hello';
@paivaric
paivaric / index.hml
Created October 27, 2017 18:35 — forked from fullsushidev/index.hml
Basic HTML file | JavaScript Quickstart tutorial | Back4App
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="Back4App Inc" name="author">
<title>Sample App| JavaScript Quickstart | Back4App</title>
@paivaric
paivaric / gist:913799cc084db131addc
Last active August 29, 2015 14:27 — forked from chrishaff/gist:83b0a3b621c3301ecc32
Install Thumbor on Ubuntu 14.04 includes python-opencv for face/feature detection. Don't forget to enable the detectors https://github.com/thumbor/thumbor/wiki/Enabling-detectors.
# sudo su and run the following
sudo apt-get update && \
sudo apt-get -y upgrade && \
# install all dependencies
sudo apt-get -y install \
build-essential \
checkinstall \
gcc \