Skip to content

Instantly share code, notes, and snippets.

View DinoChiesa's full-sized avatar

Dino Chiesa DinoChiesa

View GitHub Profile
// ==UserScript==
// @namespace user-apigee
// @name Change banner jewel color Edge UI OPDK
// @description Change banner jewel color depending on environment selector
// @match http://localhost:9000/*
// @match http://127.0.0.1:9000/*
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant none
// @version 0.1.1
// @run-at document-end
#!/bin/bash
# -*- mode:shell-script; coding:utf-8; -*-
#
# pcopy is "preserve copy"? copy a file while preserving the directory structure.
#
#
# Created: <Fri Jun 24 13:07:52 2016>
# Last Updated: <2016-July-19 20:25:05>
#
# example:
// dateFormat.js
// ------------------------------------------------------------------
//
// format a date, easily.
//
// created: Mon Jul 18 11:24:41 2016
// last saved: <2016-July-18 11:47:12>
;(function (){
// humanizeDuration.js
// ------------------------------------------------------------------
//
// derived from https://github.com/EvanHahn/HumanizeDuration.js
//
// created: Mon Jul 18 11:13:09 2016
// last saved: <2016-July-18 11:15:53>
;(function (){
private LoadingCache<String, JWSVerifier> macVerifierCache;
...
macVerifierCache = CacheBuilder.newBuilder()
.concurrencyLevel(4)
.maximumSize(1048000)
.expireAfterAccess(10, TimeUnit.MINUTES)
.build(new CacheLoader<String, JWSVerifier>() {
public JWSVerifier load(String key) throws UnsupportedEncodingException {
byte[] keyBytes = key.getBytes(StandardCharsets.UTF_8);
// NB: this will throw if the string is not at least 16 chars long
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; restclient - invoke REST API calls from within Emacs
(require 'restclient)
(eval-after-load "restclient"
(if (not (fboundp 'json-pretty-print-buffer))
(defun json-pretty-print-buffer ()
(json-prettify-buffer))))
# -*- restclient -*-
#
# URLs for querying Apigee Edge
# Yes, this runs within emacs.
:edge-auth := (dino-netrc-basic-auth-header "api.enterprise.apigee.com")
:mgmtserver = https://api.enterprise.apigee.com
GET :mgmtserver/v1/o/deecee/apis/parity-test99/revisions
Authorization: :edge-auth
// TestWebRequest.cs
// ------------------------------------------------------------------
//
// Author: Dino
// initialized on: Fri Feb 26 17:00:17 2016
//
// last saved: <2016-February-26 17:19:13>
// ------------------------------------------------------------------
//
// Copyright © 2016 Dino Chiesa
#!/bin/bash
# -*- mode:shell-script; coding:utf-8; -*-
#
# findApiKey.sh
#
# A bash script for finding a particular API Key in an Apigee Edge organization.
#
# Last saved: <2016-February-05 17:30:50>
#
@DinoChiesa
DinoChiesa / .htaccess
Created January 29, 2016 21:09
to force a server to load SSL endpoint
RewriteCond %{SERVER_PORT} !=443
RewriteRule .* https://%{HTTP_HOST}/$1 [R=301,L]