Skip to content

Instantly share code, notes, and snippets.

dave-britten / Compare-ADGroupMembership.ps1
Created Oct 1, 2018
Compares group membership of 2 or more users
View Compare-ADGroupMembership.ps1
Function Compare-ADGroupMembership {
Param (
$groups = @{}
#Attempt to load a .pyui file and generate code that would produce the same results.
#Note: this doesn't actually work yet.
from __future__ import print_function
infilename = raw_input("Input File?")
#infilename = "RegexSandbox.pyui"
outfilename = infilename + ".py"
f = open(infilename, "r")
dave-britten /
Last active Sep 1, 2015
Calculate a probability distribution of totals acquired from rolling an arbitrary number of dice, each with an arbitrary configuration of non-negative, integer face values.
import re
dice = [] #Input dice as polynomial coefficients
print "Enter face values as non-negative integers, separated by spaces, commas, or semicolons. (e.g. \"1,2;3 4 5 6\")"
while True:
rawdie = [] #List of face values
qty = 1 #Quantity of a single die spec
inp = raw_input("Die " + str(len(dice) + 1) + "? ")
dave-britten /
Last active Aug 4, 2017
Select and resize an image from iOS device's photo library. (Pythonista)
#Gist ID: 9951701907ed328218dd
import console
import photos
from PIL import Image
from PIL.ExifTags import TAGS
def adjust(dim, newdim):
newdim = newdim.strip()
if newdim[-1] == "%":