Skip to content

Instantly share code, notes, and snippets.

View farooqarahim's full-sized avatar
:octocat:

Farooq A Rahim farooqarahim

:octocat:
View GitHub Profile
@farooqarahim
farooqarahim / somedomain.com.conf
Last active January 17, 2020 02:24
Nginx : Ghost SSL Config
#Nginx Ghost Config
server {
listen 80;
server_name somedomain.com;
rewrite ^(.*) https://$host$1 permanent;
}
# the secure nginx server instance
server {
listen 443 ssl;
@pbojinov
pbojinov / README.md
Last active November 5, 2025 23:10
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@pauloricardomg
pauloricardomg / cors.nginxconf
Last active July 7, 2025 05:14
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {
@SeanCline
SeanCline / http_listener_test.cpp
Last active March 20, 2025 09:04
A simple test of the experimental http_listener provided by the C++ REST SDK (Casablanca).
#define _CRT_SECURE_NO_DEPRECATE
#include <cpprest/http_listener.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <thread>
#include <chrono>
#include <ctime>
@alexjs
alexjs / cors-nginx.conf
Created November 28, 2012 22:42 — forked from michiel/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#