Skip to content

Instantly share code, notes, and snippets.

@sheeley
sheeley / Overview
Created August 6, 2015 00:02
MirrorMaker Partition Test
This test creates keyed messages and pushes them to one Kafka broker (source).
Mirror maker is consuming from source and pushing to destination.
After publishing, the test consumes first from source, then destination, and compares the counts per partition.
Output:
running with topic EQEVYCTWOV
publishing 10000 messages to EQEVYCTWOV
partition source destination match
// this gets you most of the way to being able to paste your account information
var trs = document.querySelectorAll('tr, input[type=text]');
for(var i = 0; i < trs.length; i++){
var tr = trs[i];
tr.onpaste = null;
tr.onkeypress = null;
tr.oncontextmenu = null;
}
document.removeEventListener('mousedown')
@sheeley
sheeley / docker-machine --debug create -d virtualbox --virtualbox-memory 2048 default
Created August 31, 2015 23:47
/usr/local/bin/docker-machine --debug create -d virtualbox --virtualbox-memory 2048 default
$DOCKER_MACHINE --debug create -d virtualbox --virtualbox-memory 2048 $VM
executing: /usr/local/bin/VBoxManage
STDOUT: Oracle VM VirtualBox Command Line Management Interface Version 5.0.2
(C) 2005-2015 Oracle Corporation
All rights reserved.
Usage:
VBoxManage [<general option>] <command>
@sheeley
sheeley / orphaned.txt
Last active September 8, 2015 17:34
git rebase leaves orphan files
➜ tcs git:(master) git checkout feature/RED-599-Bundling
Branch feature/RED-599-Bundling set up to track remote branch feature/RED-599-Bundling from origin.
Switched to a new branch 'feature/RED-599-Bundling'
➜ tcs git:(feature/RED-599-Bundling) git rebase feature/fanatics
First, rewinding head to replay your work on top of it...
Applying: PDP Round swatches, exposed sizing.
Applying: More updates to the PDP; circle swatches, flush left, fixed color swatch
Using index info to reconstruct a base tree...
M TCS.Website/Areas/Fullsite/Views/Catalog/ProductDetails.ascx
M TCS.Website/css/fullsite/global.css
@sheeley
sheeley / bower
Created September 24, 2015 17:43
bower log
➜ bower-test npm -g list
^C
➜ bower-test npm -g list | grep bower
├─┬ [email protected]
│ ├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
├─┬ [email protected]
@sheeley
sheeley / ip_cleaner.py
Created September 21, 2016 16:42
IP Cleaner
# Scrubs a file of ip addresses, renaming anything that isn't broadcast to 10.0.0.(1-n)
import re
import sys
pattern = '(?:[0-9]{1,3}\.){3}[0-9]{1,3}'
def main():
with open('output.txt', 'r') as output_file:
output = output_file.read()
@sheeley
sheeley / list.js
Created October 7, 2016 23:12
restify list routes by path
const output = {}
for (const verb of Object.keys(server.router.routes)) {
console.log(verb)
for (const route of server.router.routes[verb]) {
const {method, spec: {path}} = route
if (!output[path]) {
output[path] = []
}
output[path].push(method)
}
@sheeley
sheeley / 1.sh
Created October 24, 2016 16:11
Updating Circle
# ssh to circleci.fanaticslabs.com
circleci dev-console
// Base implementation:
function videoExperience(options) {
var elem = document.createElement("...")
// attach handlers, set up video/images/etc
return elem
}
// TCS:
var video = videoExperience(options)
document.getElementById("videoContainer").appendChild(video)
@sheeley
sheeley / process.sh
Created December 28, 2017 16:22
process kindle books json
# takes json from ajax request on list of kindle ebooks, returns title, author, url
cat books.json | jq '.GetContentsForCollection | .asinDetails[] | .title + " - " + .authors + " www.amazon.com" + .dpURL'