Skip to content

Instantly share code, notes, and snippets.

Mike Lloyd mxplusb

Block or report user

Report or block mxplusb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View build.cake
#addin "nuget:?package=Cake.FileHelpers&version=3.2.0"
var target = Argument<string>("target");
var globalOutputDir = new DirectoryPath("./build");
var taskHelp = new Dictionary<string,string>() {
{
"Project.DevServer", "Compiles the Project Development Server, which can be easily used for quick and dirty local development."
},
View build.cake
var target = Argument("target", "Welcome");
List<string> tasks = new List<string>();
Setup(context => {
foreach(var task in context.TasksToExecute) {
Information("task: {0}", task.Name);
tasks.Append(task.Name);
}
});
@mxplusb
mxplusb / bootstrap.py
Created May 10, 2019
Bootstrap a new set of packages not included in the Python3 stdlib.
View bootstrap.py
class Bootstrap(object):
"""
Bootstrap a new set of packages not included in the Python3 stdlib.
"""
def __init__(self, **kwargs):
self.__dict__.update(**kwargs)
self._init()
def _init(self):
@mxplusb
mxplusb / stack.py
Created May 9, 2019
Directory stacks in Python
View stack.py
# directory stack
_directory_stack = []
def pushd(target: str):
"""
Push a new directory to the top of the stack and changes to it.
Arguments:
target {str} -- Where you want to go
@mxplusb
mxplusb / headers.json
Created May 7, 2019
Registered HTTP headers in JSON format
View headers.json
{
"Accept": [""],
"Accept-Charset": [""],
"Accept-Encoding": [""],
"Accept-Language": [""],
"Accept-Ranges": [""],
"Access-Control-Allow-Credentials": [""],
"Access-Control-Allow-Headers": [""],
"Access-Control-Allow-Methods": [""],
"Access-Control-Allow-Origin": [""],
@mxplusb
mxplusb / RabbitMQCheckpointRecord.cs
Created May 5, 2019
RabbitMQ checkpoint code for Microsoft Orleans
View RabbitMQCheckpointRecord.cs
using System.ComponentModel.DataAnnotations;
namespace Orleans.RabbitMQ.Providers
{
public class RabbitMQCheckpointRecord
{
[Key]
public int Id;
public string Offset;
public string StreamProviderName;
View feature-as-you-go.py
import matplotlib.pyplot as plt
import numpy as np
PRICE_SHEET = {
"scale_amount": 1000,
"base_price": 1,
"feature_x": 0.1,
"feature_y": 0.15,
"feature_z": 0.20,
}
@mxplusb
mxplusb / syncer.py
Created Feb 5, 2019
Sync Credhub to Vault
View syncer.py
#!/usr/bin/env python3
import json
import logging
import os
import subprocess
import shlex
import sys
import hvac
@mxplusb
mxplusb / proc.go
Last active Jan 10, 2019
Background processes in Windows with Go.
View proc.go
package main
import (
"errors"
"fmt"
"golang.org/x/sys/windows"
"syscall"
"time"
"unsafe"
)
View bosh-27651.log
This file has been truncated, but you can view the full file.
I, [2018-11-09T18:02:39.370726 #16] [0x3f96308f4548] INFO -- TaskHelper: Director Version: 268.1.0
I, [2018-11-09T18:02:39.370833 #16] [0x3f96308f4548] INFO -- TaskHelper: Enqueuing task: 27651
I, [2018-11-09T18:02:40.115109 #5668] [] INFO -- DirectorJobRunner: Looking for task with task id 27651
D, [2018-11-09T18:02:40.116683 #5668] [] DEBUG -- DirectorJobRunner: (0.000459s) (conn: 47329200342920) SELECT * FROM "tasks" WHERE "id" = 27651
I, [2018-11-09T18:02:40.119102 #5668] [] INFO -- DirectorJobRunner: Found task #<Bosh::Director::Models::Task @values={:id=>27651, :state=>"processing", :timestamp=>2018-11-09 18:02:39 UTC, :description=>"create deployment", :result=>nil, :output=>"/var/vcap/store/director/tasks/27651", :checkpoint_time=>2018-11-09 18:02:39 UTC, :type=>"update_deployment", :username=>"admin", :deployment_name=>"cf", :started_at=>nil, :event_output=>"", :result_output=>"", :context_id=>""}>
You can’t perform that action at this time.