Skip to content

Instantly share code, notes, and snippets.

@jagwire
jagwire / gist:0129d50778c8b4462b68
Created December 11, 2014 15:12
Unity command line script to build WebGL player
//place this script in the Editor folder within Assets.
using UnityEditor;
//to be used on the command line:
//$ Unity -quit -batchmode -executeMethod WebGLBuilder.build
class WebGLBuilder {
static void build() {
string[] scenes = {"Assets/main.unity"};
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
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

@jcppkkk
jcppkkk / OpenWithSublime.bat
Last active June 25, 2023 22:07 — forked from FoxColdMetal/OpenWithSublimeText.bat
[[[ Move to https://github.com/jcppkkk/OpenWithSublime !!! ]]] Add context menu to allow user open file or folder with Sublime as User (or as Admin).
@echo off
:: Path to Sublime Text installation dir.
SET stPath=%~dp0sublime_text.exe
SET stPathOnly=%~dp0
:: Key name for the registry entries.
SET UserEntry=Sublime Text
SET AdminEntry=Sublime Text As Admin
:: Context menu texts.
SET "UserMenuText=Open with Sublime(&-)"
SET "AdminMenuText=Open with Sublime As Admin(&+)"
@roxlu
roxlu / Socket.cpp
Created September 12, 2012 20:53
Basic Winsock/Posix client socket wrapper (windows/mac)
#include <roxlu/io/Socket.h>
Socket::Socket() {
#ifdef _WIN32
int result = WSAStartup(MAKEWORD(2,2), &wsa_data);
if(result != 0) {
printf("Error: cannot initialize WinSock.\n");
WSACleanup();
}
#endif