Skip to content

Instantly share code, notes, and snippets.

View darbio's full-sized avatar

JD darbio

View GitHub Profile
@darbio
darbio / s3-parallel-put.py
Last active June 8, 2023 10:59
S3 parallel put updated to use Python3 and logging changed to use print(), converted from https://github.com/mishudark/s3-parallel-put
#!/usr/bin/env python
# Parallel uploads to Amazon AWS S3
#
# The MIT License (MIT)
#
# Copyright (c) 2011-2014 Tom Payne
# Copyright (c) 2022-2023 James Darbyshire (updated to Python 3)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@darbio
darbio / Address.cs
Created November 20, 2018 23:52
Address class
using System;
using System.Collections.Generic;
using System.Linq;
namespace Darb.io.Core
{
// Based upon Microsoft Address Class
// https://msdn.microsoft.com/en-us/library/cc966788.aspx
public class Address
{
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'IRule' could not be found (are you missing a using directive or an assembly reference?) Peasy..NETStandard,Version=v1.5 C:\Users\james\Desktop\darbio\Peasy.NETCore\Peasy.NET\Peasy\Extensions\GenericExtensions.cs 9 Active
Error CS0234 The type or namespace name 'DataAnnotations' does not exist in the namespace 'System.ComponentModel' (are you missing an assembly reference?) Peasy..NETStandard,Version=v1.5 C:\Users\james\Desktop\darbio\Peasy.NETCore\Peasy.NET\Peasy\Extensions\DomainObjectExtensions.cs 5 Active
Error CS0234 The type or namespace name 'Core' does not exist in the namespace 'Peasy' (are you missing an assembly reference?) Peasy..NETStandard,Version=v1.5 C:\Users\james\Desktop\darbio\Peasy.NETCore\Peasy.NET\Peasy\Extensions\GenericExtensions.cs 1 Active
Error CS0234 The type or namespace name 'Serialization' does not exist in the namespace 'System.Runtime' (are you missing an assembly reference?)
@darbio
darbio / index.js
Created May 26, 2016 03:08
Task bpmn code
var bpmn = require("bpmn");
var logLevels = require('bpmn').logLevels;
console.log("Starting");
bpmn.createUnmanagedProcess(__dirname + "/task.bpmn", function(err, myProcess) {
myProcess.setLogLevel(logLevels.debug);
myProcess.triggerEvent("MyStart");
});
@darbio
darbio / diagram.bpmn
Created May 26, 2016 02:50
bpmn won't progress to next task
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn:process id="Process_1" isExecutable="true">
<bpmn:startEvent id="StartEvent_0u6igzm" name="Start">
<bpmn:outgoing>SequenceFlow_0dj0shd</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:task id="Task_1j1u5jd" name="Send email">
<bpmn:incoming>SequenceFlow_0dj0shd</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1yqx4t9</bpmn:outgoing>
</bpmn:task>
@darbio
darbio / StackCreatePS.ps1
Last active February 3, 2016 22:54
cfn.ps1
#
# AWS Deploy CloudFormation template and return stack ID
# powershell.exe deploy.ps1 -template templateName.json
#
param(
[String]$template="template.json"
)
Import-Module AWSPowerShell
@darbio
darbio / Diagnosis.cs
Last active January 15, 2016 01:17
IIS Express Threadpool Exceptions
int workers;
int completions;
System.Threading.ThreadPool.GetMaxThreads(out workers, out completions);
// Set the variables
string smtpAddress = "mail.example.com";
string fromAddress = "from@example.com";
// Create the SMTPClient
var smtp = new SmtpClient(smtpAddress);
smtp.Credentials = new NetworkCredential("username", "password");
// Construct the MailMessage
var mail = new MailMessage();
string queueUrl = "YOUR_QUEUE_URL";
using (var client = new Amazon.SQS.AmazonSQSClient(Amazon.RegionEndpoint.APSoutheast2))
{
while (true)
{
// Get the messages
var response = client.ReceiveMessage(queueUrl);
// Check our response
if (response.Messages.Count > 0)
@darbio
darbio / README.md
Last active January 15, 2016 00:14
Development machine (VS 2015, Node, Python)

What is it

This is a powershell script that will install chocolatey onto a new Windows machine, set the folder options to view all files and then install the following packages for a fresh development enviromnment:

  • Dot Net frameworks 3.5-4.6.1 (inclusive)
  • git
  • VS Code
  • VS 2015 pro
  • Node
  • Python 2