Skip to content

Instantly share code, notes, and snippets.

$b = [System.Text.Encoding]::UTF8.GetBytes((gc script.ps1))
$script = [System.Convert]::ToBase64String($b)
$ami=Get-EC2Image -Owner self -Filters @{ Name="name"; Values="Clarity PPM Pristine Latest" } | select -expand ImageId
$resp = New-EC2Instance `
-ImageId $ami `
-MinCount 1 `
-MaxCount 1 `
-InstanceType c3.xlarge `
library(RCurl)
library(jsonlite)
#'https://www14.v1host.com/v1sdktesting/query.legacy.v1?query=' -> api
'http://54.242.130.237/VersionOne/query.legacy.v1?query=' -> api
auth <- 1L
'admin:admin' -> creds # Just another way of assigning values to variables!
# Get aroud Server-side SSL errors!
options(RCurlOptions = list(cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")))
public class when_I_roll_a_game_with_even_a_single_strike_and_try_to_roll_past_ten_frames : concerns<BowlingGame>
{
[Specification]
public void then_I_get_an_exception()
{
Assert.Throws<ApplicationException>(() =>
{
var game = build_up();
game.Roll(10);
9.times(() =>
@JogoShugh
JogoShugh / gist:00f07c8e7dce20bbb295
Last active August 29, 2015 14:05
Web API Design notes

Web APIs

  • Should be self-describing
  • Devs want to see examples quickly, not read for hours on end just to figure out basics
  • RPC -> REST -> HATEOAS
  • Avoid dogma of REST vs the world

URI Design

  • Start with nouns, not verbs

To run as a service on a Windows machine, do the following:

Assuming you have Git installed:

  • Open a Git Bash prompt.
  • Navigate to a folder where you would like to install the Requestor.
  • Type git clone https://github.com/versionone/VersionOne.Client.Requestor.git
  • Type cd VersionOne.Client.Requestor to change into the newly cloned repository directory.
  • Follow the steps in Configure for VersionOne Projects for editing the config.js and fields.js files to your needs.
  • Modify the package.json file such that the scripts property looks like this (simply prefixing node to the "start" sub-property):
@JogoShugh
JogoShugh / CS.md
Last active August 29, 2015 14:06

How to run CommitStream from scratch with commits from a source GitHub repo

This is a work in progress. As this evolves, we update this narrative.

Scenario

Given you have a GitHub repository that has commits matching the VersionOne asset mention pattern, like S-12345, D-00312, etc, and you want to start seeing those correlated with those assets inside VersionOne's asset detail view, then:

Install VersionOne with CommitStream loader build

  • Install a VersionOne build from ci-server/job/CommitStream-core-developing/
namespace VersionOne.Utility.Functional
open System.Net
open System
open System.IO
open Newtonsoft.Json
open Newtonsoft.Json.Linq
module Web =
@JogoShugh
JogoShugh / client_app.js
Created October 23, 2014 14:43
Meteor Team Order Selector
//client only code
Template.teams.teams = function () {
return Teams.find();
};
Template.teams.events({
'click .spin': function() {
Meteor.call('spin');
}
postDigest = (shouldBehaveThusly) ->
request(app).post("/api/digest", "myfirstdigest").end shouldBehaveThusly
getDigest = (path, shouldBehaveThusly) ->
request(app).get(path).end shouldBehaveThusly
chai = require("chai")
should = chai.should()
express = require("express")
app = express()
chai = require("chai")
sinon = require("sinon")