Skip to content

Instantly share code, notes, and snippets.

View dwalleck's full-sized avatar

Daryl Walleck dwalleck

View GitHub Profile
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"profiles":
@dwalleck
dwalleck / cloudSettings
Last active March 12, 2020 18:56
vs code config
{"lastUpload":"2020-03-12T18:56:16.230Z","extensionVersion":"v3.4.3"}
from collections import namedtuple
IndexValue = namedtuple("IndexValue", "index value")
def merge_streams_better(streams):
if len(streams) == 1:
return list(streams[0])
merged_list = []
stream_pairs = [
IndexValue(index, next(value)) for index, value in enumerate(streams)
@dwalleck
dwalleck / contributions.md
Created July 16, 2019 15:50
OpenCafe/CloudCafe Contributions

Open Source Contributions

OpenCafe (test framework) - https://github.com/CafeHub/opencafe

- Test runner: https://github.com/CafeHub/opencafe/blob/master/cafe/drivers/unittest/runner.py
- Configuration manager: https://github.com/CafeHub/opencafe/tree/master/cafe/common/reporting
- Virtual machine validator: https://github.com/openstack/cloudcafe/tree/master/cloudcafe/compute/common/clients/remote_instance

OpenStack SDKs for testing purposes

@dwalleck
dwalleck / primes.py
Created June 14, 2019 17:02
Prints the first N primes
import math
import sys
def is_prime(a):
"""
https://stackoverflow.com/questions/1801391/what-is-the-best-algorithm-for-checking-if-a-number-is-prime
"""
if a < 2:
return False
elif a !=2 and a % 2 == 0:
@dwalleck
dwalleck / index.js
Created May 22, 2019 19:03
Azure auth subscriptions returned example
const msRestNodeAuth = require('@azure/ms-rest-nodeauth');
const msRest = require('ms-rest-azure');
const clientId = '';
const clientSecret = ''
const tenantId = '';
const main = async () => {
const oldCreds = await msRest.loginWithServicePrincipalSecretWithAuthResponse(
clientId,
@dwalleck
dwalleck / vs-code.conf
Created April 9, 2019 16:31
Place in /etc/sysctl.d to set max watchers correctly for VS Code on Linux
# Increase inotify limit, required by Visual Studio Code https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
fs.inotify.max_user_watches = 524288
namespace Minerva
{
class Program
{
static async System.Threading.Tasks.Task Main(string[] args)
{
CredentialProfile profile;
AWSCredentials credentials;
var sharedFile = new SharedCredentialsFile();
Download of xunit 20.0.0 done in 2 seconds. (12 kbit/s, 0 MB)
Something went wrong while downloading xunit 20.0.0
Message: Error during extraction of C:\Users\dwall\source\repos\openstack.net\packages\xunit\xunit.20.0.0.nupkg.
==> Last trial
Downloading xunit 20.0.0
Download of xunit 20.0.0 done in 1 second. (27 kbit/s, 0 MB)
Performance:
- Disk IO: 887 milliseconds
- Average Download Time: 478 milliseconds
const index = require('../index');
const event = require ('../event.json');
const Compute = require('@google-cloud/compute');
const Bluebird = require('bluebird');
jest.mock('bluebird');
jest.mock('@google-cloud/compute', () => {
return jest.fn().mockImplementation(() => {
return {
getVMsAsync: jest.fn(),
getAddressesAsync: jest.fn(),