Since Mavericks stopped using the deprecated ipfw
(as of Mountain Lion), we'll be using pf
to allow port forwarding.
####1. anchor file
Create an anchor file under /etc/pf.anchors/<anchor file>
with your redirection rule like:
/* Custom JS for Advanced Search Form */ | |
jQuery(document).ready(function($) { | |
// A utility function we'll use to make a JQuery selector | |
// on a particular string 'id'. HTML id allows : or . chars, | |
// but need to be escaped in JQuery selectors. | |
// See http://docs.jquery.com/Frequently_Asked_Questions#How%5Fdo%5FI%5Fselect%5Fan%5Felement%5Fby%5Fan%5FID%5Fthat%5Fhas%5Fcharacters%5Fused%5Fin%5FCSS%5Fnotation.3F | |
function jq_id_select_escape(str_id) { | |
return str_id.replace(/(:|\.)/g,'\\$1'); |
class Tinyurl | |
include HTTParty | |
base_uri 'tinyurl.com' | |
def shorten(url) | |
self.class.get("/api-create.php?url=#{url}") | |
end | |
end |
insertBookCoverImage = (data) -> | |
for id, values of data | |
imgId = values.bib_key.toLowerCase().replace(":", "_") | |
$("##{imgId}").attr("src", values.thumbnail_url) | |
addBookCovers = (ids) -> | |
url = "http://books.google.com/books?bibkeys=#{ids}&jscmd=viewapi&callback=?" | |
$.getJSON url, {}, insertBookCoverImage |
app_dir = "/home/public_forums/unstable/" | |
worker_processes 5 | |
pid "#{app_dir}/tmp/pids/unicorn.pid" | |
# listen "#{app_dir}/tmp/sockets/public_forum.socket" | |
listen 5000, :tcp_nopush => true | |
stderr_path "#{app_dir}/log/unicorn.stderr.log" | |
stdout_path "#{app_dir}/log/unicorn.stdout.log" |
Rails flash messages with AJAX requests
# These modules should be loaded by default: proxy_module, proxy_balancer_module, rewrite_module | |
Listen *:80 | |
# You may want to keep the VirtualHost config under extra/*.conf | |
# Start your thin | |
<VirtualHost *:80> | |
ServerName wwww.yourawesomeapp.dev |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Testing Pie Chart</title> | |
<!--<script type="text/javascript" src="d3/d3.v2.js"></script>--> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<!-- Note: I made good use of the sample code provided by the D3JS community and extended it to fit my needs to create this simple dashboard --> | |
<style type="text/css"> |