Skip to content

Instantly share code, notes, and snippets.

View hanynowsky's full-sized avatar
💭
I may be slow to respond.

Hanynowsky hanynowsky

💭
I may be slow to respond.
View GitHub Profile

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

#!/usr/bin/env ruby
# estimate the dewpoint temperature
def dew_point(temp, rv)
e = 6.1121 * (10 ** (7.502 * temp / (237.7 + temp)))
p = (rv * e) / 100.0
dp = (-430.22 + 237.7 * Math.log(p))/(-(Math.log(p)) + 19.08);
end
# estimate the wet bulb temperature
<% header "Content-Type" => "text/html" %>
<h1>Let's run some ruby code: <%= rand %></h1>
#!/bin/sh
sudo yum -y install js-devel
mkdir -p ~/bin
curl -L http://github.com/micha/jsawk/raw/master/jsawk > ~/bin/jsawk
chmod 755 ~/bin/jsawk
@hanynowsky
hanynowsky / gist:4302692
Created December 16, 2012 02:52
Jambi-Sample
package jambi;
import com.trolltech.qt.gui.*;
public class HellowWorld {
public static void main(String args[]) {
QApplication.initialize(args);
QPushButton hello = new QPushButton("Hello World!");
hello.resize(120, 40);