Skip to content

Instantly share code, notes, and snippets.

@maxlinc
maxlinc / benchmark.rb
Created February 9, 2015 20:27
Zip benchmark
require 'winrm-fs'
require 'benchmark'
manifest = 'files.txt'
files = File.read(manifest).lines
files = files.map do | file |
next if file =~ /COMMIT_EDITMSG/
File.expand_path(file.strip, Dir.pwd)
end.compact
@maxlinc
maxlinc / README.md
Created December 11, 2014 22:51
Rsync: OSX to Windows, using cwrsync installed via chocolatey

Windows (Guest):

rsync --daemon --verbose --no-detach --config=rsyncd.conf --port=2222

Host:

rsync -avzr scripts/ rsync://windows_hostname:2222:/tmp/scripts
@maxlinc
maxlinc / autoscale.wadl
Last active August 29, 2015 14:09
Autoscale WADL (XML) vs Swagger (YAML)
<?xml version="1.0" encoding="utf-8"?>
<!--*******************************************************-->
<!-- Import Common XML Entities -->
<!-- -->
<!-- You can resolve the entites with xmllint -->
<!-- -->
<!-- xmllint -noent autoscale.wadl -->
<!--*******************************************************-->
<!-- need xmlns:identity to use &commonFaults; &postPutFaults; &listGroupFaults; &createGroupFaults;
&showGroupDetailsFaults; &deleteGroupFaults; &deleteGroupServerFaults; &getGroupStateFaults; &getGroupConfigurationFaults; &updateGroupConfigurationFaults;
@maxlinc
maxlinc / delete_webhook.json
Created August 15, 2014 21:14
Pitchfork db structure
{
"_id" : ObjectId("528f67f1192a8b5ae48ebed9"),
"add_to_header" : false,
"api_uri" : "{ddi}/groups/{group_id}/policies/{policy_id}/webhooks/{webhook_id}",
"custom_header_key" : "",
"custom_header_value" : "",
"data_object" : "",
"doc_url" : "http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/DELETE_deleteWebhook_v1.0__tenantId__groups__groupId__policies__policyId__webhooks__webhookId__Webhooks.html",
"short_description" : "Delete the specified webhook from the specfied policy on the specified scaling group",
"tested" : true,
{
"request": {
"headers": {
},
"http_method": "get",
"path": "/api/album/{id}/cover"
},
"response": {
"headers": {
"Content-Type": "application/json"
@maxlinc
maxlinc / current.yaml
Last active August 29, 2015 14:04
examples
---
examples:
application/json:
category:
name: domestic
id: 9
name: monster
status: alive
tags:
-
@maxlinc
maxlinc / draft4.json
Last active August 29, 2015 14:04
ZSchema bug?
{
"id": "http://json-schema.org/draft-04/schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Core schema meta-schema",
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#" }
},
@maxlinc
maxlinc / template_with_arrays.rb
Last active August 29, 2015 14:04
URI template sample
template = Addressable::Template.new 'http://open.mapquestapi.com/staticmap/v4/getmap{?key,size,zoom,center}'
template.expand key: 'foo', size: [200, 400], zoom: 5, center: [200, 9]
# => <Addressable::URI:0x3ffb7b824dd8 URI:http://open.mapquestapi.com/staticmap/v4/getmap?key=foo&size=200,400&zoom=5&center=200,9>
template.expand size: [200, 400], center: [200, 9]
# => <Addressable::URI:0x3ffb7b801ce8 URI:http://open.mapquestapi.com/staticmap/v4/getmap?size=200,400&center=200,9>
template.expand size: [200, 400]
# => <Addressable::URI:0x3ffb7a1d3714 URI:http://open.mapquestapi.com/staticmap/v4/getmap?size=200,400>
Vagrant.configure("2") do |config|
config.vm.define :suite_brettswift_com do |nodeserver|
config.vm.provider :rackspace do |rs, override|
override.vm.box = "rackspace"
override.vm.box_url = "https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box"
rs.username = "#{ENV['RACKSPACE_USERNAME']}"
@maxlinc
maxlinc / Vagrantfile
Last active November 12, 2020 11:03
Workaround for Vagrant #2733
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "dummy"
config.vm.provider :rackspace do |rs|