Skip to content

Instantly share code, notes, and snippets.

View robertz's full-sized avatar

Robert Zehnder robertz

View GitHub Profile
@robertz
robertz / gist:3130669
Created July 17, 2012 17:20
Sample jqDump document
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; UTF-8" />
<title>Test Page</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js" type="text/javascript"></script>
<script src="jqDump.js" type="text/javascript"></script>
</head>
<body>
<div id="content" style="display: inline-block; width: 400px;"></div>
@robertz
robertz / gist:3154238
Created July 21, 2012 02:02
Railo/ACF Template for Nginx
server {
listen 80;
server_name example.com;
root /var/www/example.com;
access_log /var/log/exmaple.access.log;
error_log /var/log/example.error.log;
location / {
# Rewrite rules and other criterias can go here
# Remember to avoid using if() where possible (http://wiki.nginx.org/IfIsEvil)
@robertz
robertz / gist:3154248
Created July 21, 2012 02:08
railo.conf
# Main Railo proxy handler
location ~ \.(cfm|cfml|cfc|jsp|cfr)(.*)$ {
proxy_pass http://127.0.0.1:8888;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
@robertz
robertz / gist:3662849
Created September 7, 2012 03:34
Chat controller
<cfcomponent>
<cfscript>
variables.instance = structNew();
instance.chatHistory = arrayNew(1);
instance.clients = arrayNew(1);
instance.messageTotal = arrayLen(instance.chatHistory);
</cfscript>
<cffunction name="init" access="public" returntype="chat">
<cfreturn this/>
@robertz
robertz / gist:4449660
Created January 4, 2013 03:23
drop.conf nginx configuration
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
location ~ /\. { access_log off; log_not_found off; deny all; }
location ~ ~$ { access_log off; log_not_found off; deny all; }
location ~ /WEB-INF/ { access_log off; log_not_found off; deny all; }
@robertz
robertz / gist:4566773
Created January 18, 2013 18:12
Chat application base html
<div id="messageContainer" style="display: none;">
<div id="displayName"><strong>Display Name</strong>: </div><br />
<div id="chatDiv" style="height: 300px; width: 80%; float: left; border: 1px solid gray; overflow: auto; background: #fff;"></div>
<div id="clientDiv" style="height: 300px; width: 18%; float: right; border: 1px solid gray; overflow: auto; background: #fff;"></div>
<br clear="all" />
<br /><br />
<div class="form-inline">
<input id="message" type="text" style="width: 90%;" />
<input type="button" id="send" value="Send" class="btn btn-primary" />
</div>
@robertz
robertz / gist:4568027
Last active December 11, 2015 07:39
Sample Nginx configuration
server {
listen 80;
server_name my.site.com;
root /var/www/my.site.com;
location / {
# Rewrite rules and other criterias can go here
# Remember to avoid using if() where possible (http://wiki.nginx.org/IfIsEvil)
try_files $uri $uri/ @rewrites;
}
location @rewrites {
2013-01-28 08:10:45 Client Support: 4.0.6a - 13623 (worldserver-daemon)
2013-01-28 08:10:45
2013-01-28 08:10:45 A World of Warcraft: Cataclysm Core Emulator
2013-01-28 08:10:45 _/_/ _/ _/_/_/ _/_/ _/_/_/ _/_/_/_/
2013-01-28 08:10:45 _/ _/ _/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/
2013-01-28 08:10:45 _/_/_/_/ _/_/ _/_/ _/ _/ _/ _/_/_/ _/_/_/
2013-01-28 08:10:45 _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
2013-01-28 08:10:45 _/ _/ _/ _/ _/ _/_/_/ _/_/ _/ _/ _/_/_/_/
2013-01-28 08:10:45 Arkania Community (c) 2013
2013-01-28 08:10:45 <http://arkania.net/>
@robertz
robertz / gist:5048657
Created February 27, 2013 15:15
Using Stripe Java API to process a charge
<cfoutput>
<cfscript>
Stripe = createObject("Java", "com.stripe.Stripe");
Stripe.apiKey = "sk_test_mkGsLqEW6SLnZa487HYfJVLf"
defaultCardParams = createObject("Java", "java.util.HashMap");
defaultChargeParams = createObject("Java", "java.util.HashMap");
defaultCardParams.put("number", "4242424242424242");
defaultCardParams.put("exp_month", javaCast("int", 12));
defaultCardParams.put("exp_year", javaCast("int", 2015));
defaultCardParams.put("cvc", "123");
server {
listen 80;
server_name example.com;
root /var/www/example.com;
index index.cfm;
access_log /var/log/example_access.log;
error_log /var/log/example_error.log;
include drop.conf;
include railo.conf;