Skip to content

Instantly share code, notes, and snippets.

@apucacao
apucacao / pitchfork_backbone.js
Created November 28, 2012 06:12 — forked from jdjkelly/pitchfork_backbone.js
Core Pitchfork Backbone App
// This is the core part of Pitchfork.com's Backbone app.
// The autobahn object in particular is a great example of how to layer backbone on to a traditional, CMS-driven media site while maintaing server-side view rendering.
var p4k = window.p4k || {};
$(function() {
var a = p4k.core = p4k.core || {};
a.Task = function(c, b) {
this.fn = c;
this.initialize(b)
};
### Keybase proof
I hereby claim:
* I am apucacao on github.
* I am ageorges (https://keybase.io/ageorges) on keybase.
* I have a public key whose fingerprint is 9F4C 1CA3 0F72 39C4 BD47 1AC1 FFBC DA35 7844 0377
To claim this, I am signing this object:
VSS.require(["TFS/DistributedTask/TaskAgentRestClient"], function(RestClient) {
var webContext = VSS.getWebContext();
var client = RestClient.getClient();
client.getServiceEndpoints(webContext.project.id).then(
function(endpoints) {
// ...
},
function(error) {
console.log('error getting service endpoints:', error);
POST /DefaultCollection/ee82e73e-0f24-4f32-8b17-e02ce99adce8/_apis/distributedtask/serviceendpointproxy HTTP/1.1
Host: launchdarkly.visualstudio.com
Connection: keep-alive
Content-Length: 78
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im9PdmN6NU1fN3AtSGpJS2xGWHo5M3VfVjBabyJ9.eyJuYW1laWQiOiJlMmE2ZTE0MC03NGQyLTQyMDktYTNkNy03MzRjNjM0MjdiOTAiLCJzY3AiOiJ2c28uZXh0ZW5zaW9uLmRlZmF1bHQgdnNvLnByb2ZpbGUgdnNvLnNlcnZpY2VlbmRwb2ludF9xdWVyeSB2c28ud29yayIsImF1aSI6IjdiZTk0NTE4LTEwNTMtNDMyYS1hODNmLTY2YmFhZDg4N2E3YiIsImhhaSI6IjFjNjA2NjU4LTFlZWItNGMwNS1iNjUzLWE3NDA1OWU2YTMyMiIsInNpZCI6ImNhZTJkYjRkLWNjNTAtNDhiOC1iYzJlLWJmZGUxNDg2MmQ2MSIsImlzcyI6ImFwcC52c3Nwcy52aXN1YWxzdHVkaW8uY29tIiwiYXVkIjoiYXBwLnZzc3BzLnZpc3VhbHN0dWRpby5jb218dnNvOjQ2M2E3ZDcyLWM5MmUtNGJiNi05NTViLWNkN2UwMzk5YTcxMSIsIm5iZiI6MTQ1NzAzMDk5MSwiZXhwIjoxNDU3MDM0NTkwfQ.toSXzLP8P_vHfDWRIu_v8zTukf2yejxktQ-XBcTqNI9e_NQYOBmUGaY0ue9W8SBlQRikKt50vN42ikiG-vH3nTRITNs-CgOALVl9YSj5Evl4lMurcVEZ5E_8JqeO8weSIDqcTHAZne15LURYi985J6oSQXqvdFnVU0BiMEM1jgFQZEBOphYA_Pe
{
"id": "cc77dce8-9bc2-4bd0-b8bb-2e252dbdd7d0",
"name": "Rollout",
"friendlyName": "LaunchDarkly Rollout",
"description": "Automatically update rollout of your feature flags during release",
"helpMarkdown": "[More information](http://docs.launchdarkly.com/docs/controlled-rollouts)",
"category": "Deploy",
"visibility": [
"Deploy"
],
VSS.require([
'ReleaseManagement/Core/RestClient'
], function(RMRestClient) {
var client = RMRestClient.getClient();
var config = VSS.getConfiguration();
var projectId = VSS.getWebContext().project.id;
config.onReleaseChanged(function(release) {
client.getReleaseWorkItemsRefs(projectId, release.id).then(
VSS.ready(function() {
VSS.getAppToken().then(
function(token) {
console.log(token);
},
function(error) {
console.log(error);
}
);
});
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="styles.css" />
</head>
<body class="ld">
<script src="sdk/scripts/VSS.SDK.js"></script>
<script>
VSS.init({
ReleaseManagementCoreJs?v=0solVMtWbpQc6bZuBGylDTxQtJDQQVsXwbOnNMopOdI1:274 TFS.ReleaseManagement.ReleaseHub.ConnectionManager.ReleaseHubEventManager: attached handler for event ReleaseManagement.ReleaseHub.ReleaseTaskLogUpdated
ReleaseManagementCoreJs?v=0solVMtWbpQc6bZuBGylDTxQtJDQQVsXwbOnNMopOdI1:274 TFS.ReleaseManagement.ReleaseHub.ConnectionManager.ReleaseHubEventManager: attached handler for event ReleaseManagement.ReleaseHub.ReleaseTasksUpdated
ReleaseManagementCoreJs?v=0solVMtWbpQc6bZuBGylDTxQtJDQQVsXwbOnNMopOdI1:274 TFS.ReleaseManagement.ReleaseHub.ConnectionManager.ReleaseHubEventManager: attached handler for event ReleaseManagement.ReleaseHub.ReleaseUpdated
ReleaseManagementCoreJs?v=0solVMtWbpQc6bZuBGylDTxQtJDQQVsXwbOnNMopOdI1:274 TFS.ReleaseManagement.ReleaseHub.ConnectionManager.ReleaseHubEventManager: removed handler for event ReleaseManagement.ReleaseHub.ReleaseTasksUpdated
ReleaseManagementCoreJs?v=0solVMtWbpQc6bZuBGylDTxQtJDQQVsXwbOnNMopOdI1:274 TFS.ReleaseManagement.ReleaseHub.ConnectionManage
{
"manifestVersion": 1,
"id": "launchdarkly-extension",
"version": "0.5.4",
"name": "LaunchDarkly VSTS Extension",
"description": "LaunchDarkly Visual Studio Team Services extension",
"publisher": "launchdarkly",
"targets": [
{
"id": "Microsoft.VisualStudio.Services"