Skip to content

Instantly share code, notes, and snippets.

@taitsmp
taitsmp / viewer-request.js
Last active April 11, 2019 16:37
from AWS. Lambda@Edge Viewer Request function does image size normalization and checking and determining what to return to the user.
// Taken from: https://aws.amazon.com/blogs/networking-and-content-delivery/resizing-images-with-amazon-cloudfront-lambdaedge-aws-cdn-blog/
'use strict';
const querystring = require('querystring');
// defines the allowed dimensions, default dimensions and how much variance from allowed
// dimension is allowed.
const variables = {
@taitsmp
taitsmp / pmml_bayesnet.ipynb
Created October 20, 2017 13:24 — forked from rtbs-dev/pmml_bayesnet.ipynb
Bayesian Network Models in PyMC3 and NetworkX
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
diff --git a/Library/Formula/ctags.rb b/Library/Formula/ctags.rb
index 87dd0ca..684cbbe 100644
--- a/Library/Formula/ctags.rb
+++ b/Library/Formula/ctags.rb
@@ -12,7 +12,10 @@ class Ctags < Formula
# fixes http://sourceforge.net/tracker/?func=detail&aid=3247256&group_id=6556&atid=106556
def patches
- { :p2 => DATA }
+ {
@taitsmp
taitsmp / gist:718140
Created November 27, 2010 18:24
Javascript function as an object
//From Pragmatic Guide to Javascript
function repeat(options) {
options = options || {};
for (var opt in (repeat.defaultOptions || {})) {
if (!(opt in options)) {
options[opt] = repeat.defaultOptions[opt];
}
}