Skip to content

Instantly share code, notes, and snippets.

View zpratt's full-sized avatar
💭
🤦‍♂️

Zach Pratt zpratt

💭
🤦‍♂️
View GitHub Profile
@zpratt
zpratt / webhook-notes.md
Last active December 9, 2019 06:59
messing with webhooks

example of invoking the api-server from a pod

  • kubectl run -n example-node-helm --rm -it api-test --image=ubuntu -- /bin/bash
  • wget --debug --header="Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" --ca-certificate=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt -O - https://kubernetes.default.svc/api/v1/namespaces/example-node-helm/pods

references

other notes

@zpratt
zpratt / local.tfvars
Created January 3, 2019 05:23
vcsim attempt (and fail)
vsphere_user="user"
vsphere_password="pass"
vsphere_host = "127.0.0.1:8989"
datacenter = "DC0"
cluster = "DC0_H0"
datastore = "datastore/LocalDS_0"
clustered_datastore = ""
network = "network/VM Network"
gateway = "192.168.1.1"
vm_folder = "vcsim-test-folder"
@zpratt
zpratt / overlay-component.jsx
Created March 29, 2015 06:53
React Google Maps Overlay Component
/**
* @jsx React.DOM
*/
'use strict';
var OverlayFactory = require('async-google-maps').BaseOverlayFactory,
React = require('react');
module.exports = React.createClass({
@zpratt
zpratt / google-maps-facade.js
Last active August 29, 2015 14:17
Google Maps facade
'use strict';
var google = global.google;
module.exports = {
create: function (mapContainer, options) {
return new Promise(function (resolve) {
var mapInstance = new google.maps.Map(mapContainer, options);
google.maps.event.addListenerOnce(mapInstance, 'idle', function () {
@zpratt
zpratt / custom-overlay-factory.js
Created March 29, 2015 06:33
Custom Overlay Factory
'use strict';
var BaseOverlay = require('./base-overlay');
module.exports = {
create: function (options) {
var overlayInstance = new BaseOverlay(options);
overlayInstance.setMap(options.map);
}
@zpratt
zpratt / complete-custom-overlay.js
Created March 29, 2015 06:16
Complete Custom Overlay
'use strict';
var google = global.google;
function positionOverlayByDimensions(projectedLatLng) {
var offsetHeight = this.el.offsetHeight,
offsetWidth = this.el.offsetWidth;
this.el.style.top = projectedLatLng.y - offsetHeight + 'px';
this.el.style.left = projectedLatLng.x - Math.floor(offsetWidth / 2) + 'px';
@zpratt
zpratt / custom-overlay-onadd.js
Created March 29, 2015 06:10
Custom Overlay - Define onAdd method
BaseOverlay.prototype.onAdd = function () {
var panes = this.getPanes();
panes.overlayLayer.appendChild(this.el);
};
@zpratt
zpratt / custom-overlay-draw.js
Created March 29, 2015 06:07
Custom Overlay - Define draw method
function positionOverlayByDimensions(projectedLatLng) {
var offsetHeight = this.el.offsetHeight,
offsetWidth = this.el.offsetWidth;
this.el.style.top = projectedLatLng.y - offsetHeight + 'px';
this.el.style.left = projectedLatLng.x - Math.floor(offsetWidth / 2) + 'px';
}
BaseOverlay.prototype.draw = function () {
var projection = this.getProjection(),
@zpratt
zpratt / custom-overlay-constructor.js
Created March 29, 2015 06:00
Custom Overlay - Define constructor
function BaseOverlay(options) {
var point = options.point;
this.el = options.el;
this.point = new google.maps.LatLng(point.lat, point.lng);
this.el.style.position = 'absolute';
}
BaseOverlay.prototype = Object.create(google.maps.OverlayView.prototype);