Skip to content

Instantly share code, notes, and snippets.

View ebaxt's full-sized avatar

Erik Bakstad ebaxt

View GitHub Profile
<html>
<head>
<meta name="parent" content="layout"/>
</head>
<body>
<col1><div>ccol1</div></col1>
<col2><div>ccol2</div></col2>
<col3><div>ccol3</div></col3>
</body>
<html>
@rbranson
rbranson / crossdomain.conf
Created February 3, 2011 21:13
nginx Flash XML policy server
# Add this to your nginx.conf under http { }
server {
listen 843;
server_name localhost;
location / {
rewrite ^(.*)$ /crossdomain.xml;
}
@davidsantiago
davidsantiago / gist:926154
Created April 18, 2011 20:55
SSH Port forwarding in Pallet!
(defmacro with-ssh-tunnel->
"Execute the body with an ssh-tunnel available for the ports given in the
tunnels map. tunnels should be a map from local ports (integers) to either
1) An integer remote port. Remote host is assumed to be 'localhost'.
2) A vector of remote host and remote port. eg, [\"yahoo.com\" 80].
Automatically closes the connection (and port forwards) on completion."
[request tunnels & body]
`(clj-ssh/with-ssh-agent [(execute/default-agent)]
(let [user# (:user ~request)
node-address# (compute/node-address (:target-node ~request))
@hugoduncan
hugoduncan / gist:2839891
Created May 31, 2012 00:41
OAuth with friend and oauthentic
(ns myapp.authenticate.oauth
"OAuth authentication"
(:require
[cheshire.core :as json]
[clj-http.client :as http]
[clojure.string :as string]
[clojure.tools.logging :as logging])
(:use
[oauthentic.core :only [build-authorization-url fetch-token]]
[ring.util.response :only [redirect]]
@dsc
dsc / jconsole-proxy.sh
Created August 7, 2012 01:15
jconsole via ssh proxy
#!/bin/bash
#/ jc -- jconsole via ssh proxy
#/
#/ Usage: jc [options] HOST JMX_PORT [PROXY_PORT=JMX_PORT] [JMX_HOST=HOST]
#/
#/ Starts a SOCKS proxy via ssh to connect to a
#/ JVM running on a remote and protected machine.
#/
#/ Arguments:
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@alexjs
alexjs / cors-nginx.conf
Created November 28, 2012 22:42 — forked from michiel/cors-nginx.conf
Slightly tighter CORS config for nginx
#
# Slightly tighter CORS config for nginx
#
# A modification of https://gist.github.com/1064640/ to include a white-list of URLs
#
# Despite the W3C guidance suggesting that a list of origins can be passed as part of
# Access-Control-Allow-Origin headers, several browsers (well, at least Firefox)
# don't seem to play nicely with this.
#
anonymous
anonymous / pipe.clj
Created December 18, 2012 12:49
(defn pipe
"Returns a vector containing a sequence that will read from the
queue, and a function that inserts items into the queue.
Source: http://clj-me.cgrand.net/2010/04/02/pipe-dreams-are-not-necessarily-made-of-promises/"
[]
(let [q (LinkedBlockingQueue.)
EOQ (Object.)
NIL (Object.)
s (fn queue-seq []
@teropa
teropa / resources.md
Last active December 4, 2020 05:42
Clojure Resources

Tutorials