Skip to content

Instantly share code, notes, and snippets.

View domgreen's full-sized avatar
👻
Boo!

Dominic Green domgreen

👻
Boo!
View GitHub Profile
@domgreen
domgreen / main.go
Created September 20, 2017 22:08
A Tour of Go - Exercise: Web Crawler
package main
// https://play.golang.org/p/hc-EOu8nYJ
import (
"fmt"
"sync"
)
type Fetcher interface {
@domgreen
domgreen / vagrantfile
Last active December 1, 2016 15:16
vagrant file for creating a unity based ubutu image for python dev
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.network "forwarded_port", guest: 80, host: 9000
#config.vm.boot_timeout = 1200
config.vm.provider "virtualbox" do |vb|
digs :: Integral x => x -> [x]
digs 0 = []
digs x = x `mod` 10 : digs (x `div` 10)
problem8 :: (Integral a) => a -> a
problem8 a = problem8' (digs a)
problem8' :: (Integral a) => [a] -> a
problem8' xs
| inputLength < 13 = 0
@domgreen
domgreen / gist:1037912
Created June 21, 2011 13:59
Using a single Azure Web Role to Host two websites
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="MultipleSitesInAzure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="FirstWebProject">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
<Site name="Web2" physicalDirectory="..\SecondWebProject">
@domgreen
domgreen / gist:988684
Created May 24, 2011 13:22
Method to convert cer to pfx cert
public static void CreatePfxCertFromCerCertAt(string cerLocation, string withPassword)
{
var directory = Path.GetDirectoryName(cerLocation);
var fileName = Path.GetFileNameWithoutExtension(cerLocation);
X509Certificate cert = new X509Certificate(cerLocation);
byte[] certData = cert.Export(X509ContentType.Pkcs12, withPassword);
System.IO.File.WriteAllBytes(directory + @"\" + fileName + ".pfx", certData);
}
@domgreen
domgreen / gist:962332
Created May 9, 2011 10:21
Setting the OS Family in Azure to enable PowerShell v2
<ServiceConfiguration osFamily="2" osVersion="*" serviceName="CloudCore" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
<Role name="WebRole">
</Role>
</ServiceConfiguration>
@domgreen
domgreen / gist:961494
Created May 8, 2011 16:51
powershell command to create a new eventlog
new-eventlog -logname 'domsEventLogs' -source 'app'
@domgreen
domgreen / gist:961492
Created May 8, 2011 16:50
powershell commands
powershell Set-ExecutionPolicy RemoteSigned -Force
powershell -ExecutionPolicy Unrestricted .\CreateEventLog.ps1
@domgreen
domgreen / gist:961490
Created May 8, 2011 16:47
azure startup task to call command line
<WebRole name="WebRole">
<Startup>
<Task commandLine="startup.cmd" executionContext="elevated" taskType="simple">
</Task>
</Startup>
</WebRole>
@domgreen
domgreen / gist:942239
Created April 26, 2011 13:15
local deployment using rake
def deploy_locally
#need to do a local CSPack Command
exec "#{STOP_LOCAL_DEV_FABRIC}"
exec "#{RUN_LOCAL_DEV_FABRIC}"
end