Skip to content

Instantly share code, notes, and snippets.

View stephenpatten's full-sized avatar

Stephen Patten stephenpatten

View GitHub Profile
@stephenpatten
stephenpatten / 1UnzipTransformer.java
Created May 25, 2020 15:26 — forked from ullgren/1UnzipTransformer.java
Mule transformer to extract a zip file into a List of InputStream
/*
* Licensed to the soi-toolkit project under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The soi-toolkit project licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@stephenpatten
stephenpatten / pom.xml
Created December 27, 2019 14:35 — forked from caspian311/pom.xml
Axis2 service with a Maven build
<!--
<project-directory>
- src
-main
- axis2
<all-wsdl-and-xsd-files>
- java
<all-src-code>
- resources
- META-INF
@stephenpatten
stephenpatten / RemoveOpenWithSublimeText3.bat
Created December 17, 2019 13:18 — forked from MrGrigri/RemoveOpenWithSublimeText3.bat
Remove "Open with Sublime Text 3" context menu in File Explorer for Windows 10
@echo off
@reg delete "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3"
@reg delete "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3"
@reg delete "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command"
@reg delete "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3"
@reg delete "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3"
@reg delete "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command"
import os
import errno
from subprocess import call
from gitlab import Gitlab
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
@stephenpatten
stephenpatten / gist:a126393bf67d71baf26881196d971ddb
Created November 4, 2019 18:33 — forked from ozh/gist:4131243
Create dot files/directories (ie .file) on Windows

#How to create a .file or .folder on Windows

There are several ways

1. Rename

  • Create file.txt
  • Rename to .file., the last dot will be dropped, you'll have .file

Works the same with a file or a directory.

@stephenpatten
stephenpatten / CookieMessageHandler.cs
Created September 6, 2019 19:17 — forked from damianh/CookieMessageHandler.cs
HttpMessageHandler for dealing with cookies in requests.
public class CookieMessageHandler : DelegatingHandler
{
private readonly CookieContainer _cookies = new CookieContainer();
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
request.Headers.Add("Cookie", _cookies.GetCookieHeader(request.RequestUri));
var response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
@stephenpatten
stephenpatten / rabbitmq-cluster.md
Created February 20, 2019 15:02 — forked from pobsuwan/rabbitmq-cluster.md
How to config rabbitmq server cluster [3 nodes]

How to config rabbitmq server cluster [3 nodes]

Do after install SLGInstallers

Edit /etc/hosts

vi /etc/hosts
192.168.10.157  rabbitmq-1
192.168.10.159  rabbitmq-2
192.168.10.161  rabbitmq-3
@stephenpatten
stephenpatten / ThreadPool.md
Created February 17, 2019 15:43 — forked from JonCole/ThreadPool.md
Intro to CLR ThreadPool Growth

ThreadPool Growth: Some Important Details

The CLR ThreadPool has two types of threads - "Worker" and "I/O Completion Port" (aka IOCP) threads.

  • Worker threads are used when for things like processing Task.Run(…) or ThreadPool.QueueUserWorkItem(…) methods. These threads are also used by various components in the CLR when work needs to happen on a background thread.
  • IOCP threads are used when asynchronous IO happens (e.g. reading from the network).

The thread pool provides new worker threads or I/O completion threads on demand (without any throttling) until it reaches the "Minimum" setting for each type of thread. By default, the minimum number of threads is set to the number of processors on a system.

Once the number of existing (busy) threads hits the "minimum" number of threads, the ThreadPool will throttle the rate at which is injects new threads to one thread per 500 milliseconds. This means that if your system gets a burst of work needing an IOCP thread, it will proces

@stephenpatten
stephenpatten / MobyLinux.ps1
Created November 17, 2018 21:13 — forked from biggyspender/MobyLinux.ps1
Set DockerNAT switch to be a private network
# See comment lines prefixed with ADDED
# It might be necessary to delete the existing DockerNAT switch in hyper-v manager
<#
.SYNOPSIS
Manages a MobyLinux VM to run Linux Docker on Hyper-V
.DESCRIPTION
Creates/Destroys/Starts/Stops A MobyLinux VM to run Docker on Hyper-V
.PARAMETER VmName
@stephenpatten
stephenpatten / GitHub-Forking.md
Last active November 4, 2018 18:15 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Note: Read the comments section of the original gist, it has some really good feedback.

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fo