Skip to content

Instantly share code, notes, and snippets.

@ediamin
ediamin / wpautop.js
Created February 27, 2017 09:49
JavaScript version of WordPress wpautop function
// source: https://github.com/andymantell/node-wpautop
function _autop_newline_preservation_helper (matches) {
return matches[0].replace( "\n", "<WPPreserveNewline />" );
},
function wpautop(pee, br) {
if(typeof(br) === 'undefined') {
br = true;
}
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@koute
koute / opengl3_hello.c
Created November 9, 2013 23:16
Minimal SDL2 + OpenGL3 example.
/*
Minimal SDL2 + OpenGL3 example.
Author: https://github.com/koute
This file is in the public domain; you can do whatever you want with it.
In case the concept of public domain doesn't exist in your jurisdiction
you can also use this code under the terms of Creative Commons CC0 license,
either version 1.0 or (at your option) any later version; for details see:
http://creativecommons.org/publicdomain/zero/1.0/