Skip to content

Instantly share code, notes, and snippets.

@joshrosso
joshrosso / bank.raml
Created June 16, 2014 23:34
bank.raml
#%RAML 0.8
title: Samuel's Banking API
version: v0.1
#baseUri: http://www.placeholder.com/api/{version}
baseUri: http://mocksvc.mulesoft.com/mocks/9d532d8f-bea1-47d3-a4f2-ccc36b193036/api/{version}
mediaType: application/json
securitySchemes:
- oauth_2: !include security_schemes.raml
traits:
- paged: !include paged.raml
@joshrosso
joshrosso / paged.raml
Created June 16, 2014 23:34
paged.raml
queryParameters:
start:
description: first record
max:
description: Maximum count to return
type: "OAuth 2.0"
settings:
accessTokenUri: "http://idonthaveany.com/uri"
authorizationUri: "http://idonthaveany.com/auth"
<flow name="SFWebService" doc:name="SFWebService">
<http:inbound-endpoint host="localhost" port="8081"
path="sfdc" exchange-pattern="request-response" doc:name="HTTP" />
<sfdc:query config-ref="Salesforce" doc:name="Salesforce"
query="dsql:SELECT BillingCity,BillingCountry,BillingPostalCode,BillingState,BillingStreet,Name
FROM Account
WHERE BillingPostalCode = '94116'" />
<json:object-to-json-transformer
doc:name="Object-to-JSON" />
</flow>
@joshrosso
joshrosso / Cuboid.java
Created September 8, 2014 21:52
Cuboid
package com.lenny.turbo
public class Cuboid {
/* All field in Java are 'private' unless specified otherwise
* ...does this app need to access the values directly after consturction?
* If so....generate getters and setters..since the spec doesn't ask for it
* I will not implement them.
*/
@Override
public int compareTo(Flight otherFlight) {
int value = Double.compare(this.getPrice(), otherFlight.getPrice());
return value;
}
func - PlaceQueen
Assume this function ensures location is valid
-> PlaceQueen[firstQueen](0,0)
-> PlaceQueen
-> PlaceQueen
-> PlaceQueen - SOLUTION FOUND
->PlaceQueen - No Valid Place Found
->PlaceQueen - No Valid Place Found
-> PlaceQueen[firstQueen](0,1)
@joshrosso
joshrosso / affirmation
Created September 17, 2015 00:25
MuleSoft Contributor Agreement Acceptance by Josh Rosso
I, Josh Rosso, have read and do accept the MuleSoft Contributor Agreement
at http://www.mulesoft.org/legal/contributor-agreement.html
Accepted on Wed Sep 16 2015 17:25:16 GMT-0700 (PDT)
#!/bin/bash
jq -r .Resources.LaunchConfigurationWorker.Properties.UserData assets/cloud-formation.json | base64 -d > launchConfigAssets.txt
jq -r .Resources.InstanceController.Properties.UserData assets/cloud-formation.json | base64 -d > controllerAssets.txt
jq -r '.systemd.units[] | select(.name=="kubelet.service") | .contents' launchConfigAssets.txt > workerKubelet.txt
jq -r '.systemd.units[] | select(.name=="kubelet.service") | .contents' controllerAssets.txt > controllerKubelet.txt
workerExecPreNum=$(grep -m 1 -n 'ExecStartPre' workerKubelet.txt | cut -f1 -d:)
workerMountNum=$(grep -m 1 -n '\-\-volume' workerKubelet.txt | cut -f1 -d:)
sed -i "${workerExecPreNum}iExecStartPre=/bin/mkdir -p /opt/cni/bin" workerKubelet.txt
#!/bin/bash
jq . assets/cloud-formation.json > cf-linted.json
base64 -w 0 launchConfigAssets.json > launchConfigAssets.base64
base64 -w 0 controllerAssets.json > controllerAssets.base64
rm launchConfigAssets.json controllerAssets.json updatedControllerKubelet.json updatedLaunchConfigKubelet.json
#!/bin/bash
sed -i 's/coreos\/hyperkube\:v1.5.2\_coreos\.1/joshrosso\/hyperkube\:special-cni/' manifests/kube-apiserver.yaml manifests/kube-proxy.yaml manifests/kube-scheduler.yaml manifests/kube-controller-manager.yaml
sed -i 's/coreos\/bootkube/joshrosso\/bootkube/' bootkube-start