Skip to content

Instantly share code, notes, and snippets.

Avatar

Derik Whittaker derikwhittaker

View GitHub Profile
View gist:86483d035dd35839530160a27197b822
exports.listObjects = {
"IsTruncated": true,
"Contents": [
{
"Key": "Folder.01/",
"LastModified": "2018-02-12T08:28:22.000Z",
"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
"Size": 0,
"StorageClass": "STANDARD"
},
View aws-sdk.js
const stubs = require('./aws-stubs');
const AWS = {};
AWS.config = {
setPromisesDependency: (arg) => {}
};
AWS.S3 = function() {
}
View gist:331d4a5befddf7fc6b2599f1ada5d866
{
"version": "0.2.0",
"configurations": [
{
"name": "Jest Tests",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/jest-cli/bin/jest.js",
"stopOnEntry": false,
"args": ["--runInBand"],
View gist:a723b61ed0d716913239c78c52d8c898
const path = require("path");
const gulp = require('gulp');
const zip = require('gulp-zip');
const run = require('gulp-run');
const runSequence = require('run-sequence');
const log = require('fancy-log');
const AWS = require('aws-sdk');
const s3 = new AWS.S3({apiVersion: '2006-03-01'});
View gist:c9a8872ed03f3df4410008dda95c08e5
const gulp = require('gulp');
const run = require('gulp-run');
const replace = require('gulp-replace');
const runSequence = require('run-sequence');
const log = require('fancy-log');
const AWS = require('aws-sdk');
const s3 = new AWS.S3({apiVersion: '2006-03-01'});
const s3Options = {
View Parsing Assembly Version Files
grunt.registerTask('parse', function(){
grunt.log.writeln('About to parse the assembly files');
var assemblyFile = grunt.file.read('./SharedAssemblyInfo.cs');
var lines = assemblyFile.split('\n');
var version = '';
var versionParts = '';
var searchString = 'AssemblyVersion';
View Dynamic Types with Interfaces
public class Foo{
public void Bar(){
var fieldValue = new {
ParentKey = "something",
SectionKey = "section",
FieldKey = "field",
LabelKey = "label"
} : IFieldValue;
}
View gist:9551405
private const string BaseFilePath = "JsonSerialization/json/";
public async static Task<string> DirectorySearchJson()
{
return await ReadFile(BaseFilePath + "DirectorySearchResults.json.txt");
}
private async static Task<string> ReadFile(string fileName)
{
var jsonFile = Path.Combine(Package.Current.InstalledLocation.Path, fileName);
View gist:9512285
[TestMethod]
public async Task Can_Create_Contact_Info_Email_Section_Correctly()
{
var json = await FileLoaders.DirectorySearchJson();
var searchResponse = JsonConvert.DeserializeObject<DirectorySearchResponse>(json);
}