This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Send Google Apps Script data to a Couch DB database | |
| function syncWithDB(data){ | |
| var username = ScriptProperties.getProperty('user'); | |
| var password = ScriptProperties.getProperty('pass'); | |
| var url = 'https://[username].cloudant.com/[dbname]/_bulk_docs'; | |
| var params = { | |
| "method" : "post", | |
| "contentType":"application/json", | |
| "validateHttpsCertificates" :false, | |
| "payload" : JSON.stringify(data), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define(['angular', 'services'], function (angular) { | |
| 'use strict'; | |
| return angular.module('myApp.controllers', ['myApp.services']) | |
| .controller('IndexCtrl', ['$scope', 'googleService' function ($scope, googleService) { | |
| $scope.login = function () { | |
| googleService.login().then(function (data) { | |
| // do something with returned data | |
| console.log(data.email); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var userGuid = "5895d593-9461-4b8b-8452-95bb82458bd2"; | |
| var apiKey = "YOUR_API_KEY"; | |
| /** | |
| * Query importio for data. | |
| * | |
| * @param {string} connectorGuid the number we're raising to a power | |
| * @param {object} input the exponent we're raising the base to | |
| * @param {string} userGuid the exponent we're raising the base to | |
| * @param {string} apiKey the exponent we're raising the base to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| using System.Web.Mvc; | |
| using System.Web.Routing; | |
| namespace MonkeyBusters.Web.Mvc | |
| { | |
| public static class SafeMvcUrls | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public RetailStreamHandler(IDocumentRepository<ShoppingCart> cartRepository) | |
| { | |
| _cartRepository = cartRepository; | |
| Get["/cart"] = x => GetListing(); | |
| Post["/cart"] = x => PostNewShoppingCart(Request.Body.FromJson<ShoppingCartForm>()); | |
| Get["/cart/{id}"] = x => GetById(x.id); | |
| } | |
| [RequiresAuthentication] | |
| public virtual Response PostNewShippingCart(ShoppingCartForm form) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| get SSH.NET (BSD License: http://sshnet.codeplex.com/license) | |
| with NuGet: | |
| >Install-Package SSH.NET -Version 2013.4.7 | |
| or just get the dll from here: http://j.mp/sshNet | |
| */ | |
| using System; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Copyright (c) 2011 Berk D. Demir <bdd@mindcast.org> | |
| * | |
| * Permission to use, copy, modify, and distribute this software for any | |
| * purpose with or without fee is hereby granted, provided that the above | |
| * copyright notice and this permission notice appear in all copies. | |
| * | |
| * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
| * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
| * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM golang:1.6.2 | |
| COPY . /go | |
| RUN go get github.com/nats-io/nats | |
| RUN go build api-server.go | |
| EXPOSE 8080 | |
| ENTRYPOINT ["/go/api-server"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nginx/ | |
| !nginx/.gitkeep | |
| !nginx/logs/.gitkeep | |
| src/ | |
| tmp/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #r "Newtonsoft.Json" | |
| #r "System.Configuration" | |
| #r "Microsoft.IdentityModel.Clients.ActiveDirectory.dll" | |
| using System.Net; | |
| using System.Configuration; | |
| using System.Security.Claims; | |
| using System.Net.Http.Headers; | |
| using Newtonsoft.Json; | |
| using Microsoft.IdentityModel.Clients.ActiveDirectory; |
OlderNewer