Skip to content

Instantly share code, notes, and snippets.

View carldanley's full-sized avatar

Carl Danley carldanley

View GitHub Profile
@carldanley
carldanley / dom-ready.js
Created September 5, 2012 16:35
Simple DOM ready() detection without jQuery
var DOM = new function(){
var IS_READY = false;
var CALLBACKS = [];
var SELF = this;
SELF.ready = function( callback ){
//check to see if we're already finished
if( IS_READY === true && typeof callback === 'function' ){
callback();
return;
when CLIENT_ACCEPTED {
set proxyheader "PROXY TCP[IP::version] [IP::remote_addr] [IP::local_addr] [TCP::remote_port] [TCP::local_port]\r\n"
}
when SERVER_CONNECTED {
TCP::respond $proxyheader
}
$Modules = Get-Module -ListAvailable
if ($Modules.name -notcontains "VMware.PowerCLI") {
Install-Module VMware.PowerCLI -Confirm:$False
}
if ($Modules.name -notcontains "VMware.WorkloadManagement") {
Install-Module VMware.WorkloadManagement -Confirm:$False
}
=============================================================================================================================================
BEFORE
=============================================================================================================================================
root@k8s-master-01:/home/carldanley# fio --rw=write --ioengine=sync --fdatasync=1 --directory=test-data --size=22m --bs=2300 --name=mytest
mytest: (g=0): rw=write, bs=(R) 2300B-2300B, (W) 2300B-2300B, (T) 2300B-2300B, ioengine=sync, iodepth=1
fio-3.1
Starting 1 process
mytest: Laying out IO file (1 file / 22MiB)
@carldanley
carldanley / ingress.yaml
Last active July 31, 2018 18:43
Intro to Kubernetes Ingress - July 31, 2018
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: hello-world
namespace: sfkm
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
labels:
app: hello-world
// external dependencies
const bPromise = require('bluebird');
// logic
exports.up = function(db, types) {
return db.sequelize.transaction(bPromise.coroutine(function* (t) {
yield db.createTable('listings', {
id: {
@carldanley
carldanley / configs.txt
Created April 16, 2017 13:39
k8s authentication & authorization webhooks
clusters:
- name: tbxaccounts
cluster:
server: https://some.auth.service/webhook-authn?cluster=kube-prod
users:
- name: apiserver
current-context: webhook
contexts:
@carldanley
carldanley / bookmarklet.js
Last active April 29, 2016 15:36
JSConf 2014 Schedule Bookmarker
( function() {
function highlightSchedule( tableIndex, scheduleValues ) {
var tables = document.querySelectorAll( 'table.schedule' );
if( tableIndex >= tables.length ) {
return;
}
var table = tables[ tableIndex ];
var rows = table.querySelectorAll( 'tr' );
for( var i = 0, len = scheduleValues.length; i < len; i++ ) {
@carldanley
carldanley / wp-modules.js
Last active December 22, 2015 00:28
Example of WP modules object
// new modules object introduction
( function( window, undefined ) {
window.wp = window.wp || {};
window.wp.modules = window.wp.modules || {};
} )( window );
// example Mediator module
wp.modules.Mediator = ( function( window, undefined ) {
@carldanley
carldanley / .jshintignore
Last active December 21, 2015 23:48 — forked from haschek/.jshintrc
// --------------------------------------------------------------------
// WordPress JSHint Ignored
// --------------------------------------------------------------------
wp-admin/js/farbtastic.js
wp-admin/js/iris.min.js
wp-includes/js/crop/*
wp-includes/js/imgareaselect/*
wp-includes/js/jcrop/*
wp-includes/js/jquery/*
wp-includes/js/mediaelement/*