Skip to content

Instantly share code, notes, and snippets.

View caryfitzhugh's full-sized avatar

Cary FitzHugh caryfitzhugh

View GitHub Profile
(ns trebuchet-idp.jose
(:require [clojure.reflect :as r]
[clojure.data.json :as json])
(:import com.nimbusds.jose.jwk.RSAKey
org.bouncycastle.openssl.jcajce.JcaPEMWriter
java.io.StringWriter))
(comment
(def jwk {:use "sig", :kty "RSA", :kid "public", :n "uLhh0hTuBEsKJ-Ujqr8tQnNRQPzeNlue9SEWt89xkzjTzENqZxj90JaWH1m6cTMYhByaGOAjylI9f47gfT92StCNyLsRt-eqOUig5Bqe93V9bLF9F-1BjgiLShZYMwM-dZ940pg9PqStosGmkAl2wA7hHq4zNltwbysyDgX_fuSn_UWLOmm5rigIl9xhcBpL5lVtiE2JTR46lPMENoFC5J8mcmSedDg92NdCujLky1SY0vszGVH7hphd_y3T-wX_2RfVPOeBFBKWw_rQ7SGTs3GD_akMO_QkAwm7DXBB7cuLfRcdvYhBkuzuiHzGS1TgRHFVBevQ-qE24ZobJvvMx7pfrbSqkBacT-THFACP0JgvGyxAYI_lMu-wRUAeBUsOT5c-XRaH3PoYhScKURBLEbA_wM7P2px88qGFZJEDAIVkRwe7Yob-F_i0cSKfeSQIPgQgA3ppXVCJdi4EBL075R5JILNAbemkdtKAbW75kn4ruh2P0ylUVfanF2ZjHwUkQ4_SGgKk5d7_KZu4cbmVAS7lazbLMJtYM6ml7gcFLlYJl-mgSa5qB9uq_lyGpfAsN8j6RylTWYGr2x3hCnhgCqfNYNFmgkPlJIv2Uu17zasbQVvnyQfIIUyMUeZKDqhJ0KfIvXZn-acIedEbgfhAig05V-OyA1aC7ft21qeDUb0", :e "AQAB"})
(jwk->pem-str jwk))

edit /etc/tomcat7/tomcat7.conf

JAVA_OPTS="-XX:SoftRefLRUPolicyMSPerMB=36000 -Xms8192m -Xmx8192m -XX:+UseConcMarkSweepGC -Djava.awt.headless=true "

Install Marlin Rasterizer:

Download. Put into

wget https://github.com/bourgesl/marlin-renderer/releases/download/v0_9_1/marlin-0.9.1-Unsafe.jar
@caryfitzhugh
caryfitzhugh / CSS.css
Last active October 4, 2017 14:18
Where TmwLand files live
// These live in app/assets/stylesheets/tmwland.scss
// and files below that.
// You'll probably make a file
// app/assets/stylesheets/tmwland/_XXXXX.scss
// and import it into the tmwland.scss file
// Put all your color definitions in tmwland/_colors.scss
// Don't worry too much about consolidating them, we'll clean up later (I think / hope!)
@caryfitzhugh
caryfitzhugh / gist:2015072
Created March 11, 2012 04:46
Simple Proof Of Concept For SVG image annotation in browser
<html>
<head>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js"></script>
<script>
/**
* A Simple Vector Shape Drawing App with RaphaelJS and jQuery
* copyright 2010 Kayla Rose Martin - Licensed under the MIT license
* Inspired by http://stackoverflow.com/questions/3582344/draw-a-connection-line-in-raphaeljs
**/
{
;; Data is the subscriptions (in reflux / re-frame)
;; Data flows from subscription to subscription
;; Some data is sourced by an API path (and is requested automatically if needed)
;; Other data is derived from other subscriptions (:sources, etc)
:data {
:all-tenants {
:api-path “/v1/tenants” ;; This would be a source / root
:key :tenants/all-tenants ;; Others could use this. And the data is stored in this key
}
swagger: "2.0"
info:
title: Test external refs
version: 0.0.0
paths:
/craziness/{complex-id}/:
get:
parameters:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<title> Yahoo Articles arstechnica</title>
<description>The Articles from CondeNast for Yahoo Syndication, for brand: arstechnica</description>
<link>https://s3.amazonaws.com/staging.publish.sindicati.cnds.io/yahoo-publications/arstechnica-articles.xml</link>
<item>
<media:content url="http://cdn.arstechnica.net/wp-content/uploads/2016/06/aip-classification-640x159.png" type="image/gif"/>
<title>Azure Information Protection makes warding off data leaks easier</title>
<description>Based on tech bought last year, new system builds on Azure Rights Management.</description>
(require '[clojure.core.async :as async])
(def file ["a" "b" {:url "http://ip.jsontest.com/"} "d" "e" {:url "http://time.jsontest.com"}])
(println "Loaded file..." (pr-str file))
(defmacro while-let
"Repeatedly executes body while test expression is true, evaluating the body with binding-form bound to the value of test."
[[form test] & body]
`(loop [~form ~test]
(when ~form
@caryfitzhugh
caryfitzhugh / test.js
Created January 6, 2014 16:06
Suggestion
var response_spy = sinon.spy();
$(document).on('recipes.response_details", response_spy);
$(document).trigger("recipes.request_details", { guid: "123"});
// Now there should be a pending AJAX request to the server.
var req = this.last_xhr_request();
// You can inspect it ot make sure it's going to the right URL, etc. (look at other tests).
-# Somewhere in here
-# Add the top_bar div.
-# Might just remove the #directions bar
-# And add yours there (we'll ned to figure out a different way to let people test then!)