Skip to content

Instantly share code, notes, and snippets.

View PatrickMcDonald's full-sized avatar

Patrick McDonald PatrickMcDonald

View GitHub Profile
@PatrickMcDonald
PatrickMcDonald / rshutdown.cmd
Created October 16, 2013 15:03
Shutdown remote PC using PSExec
psexec \\servername shutdown -t 0 -r -f
@PatrickMcDonald
PatrickMcDonald / .gitignore
Created October 17, 2013 10:15
Visual Studio .gitignore file
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
@PatrickMcDonald
PatrickMcDonald / log_commands
Last active December 25, 2015 20:59
Sublime Text: Log all commands run from key bindings and the menu to the console
' Enable
sublime.log_commands(True)
' Disable
sublime.log_commands(False)
@PatrickMcDonald
PatrickMcDonald / DefaultNetworkCredentials.cs
Last active March 31, 2021 07:49
Tell .NET application to use default proxy configuration
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;
ifconfig | grep "inet " | grep -v 127.0.0.1
(ns week1.core
(:gen-class))
(defn -main
"I don't do a whole lot ... yet."
[& args]
(println "Hello, World!"))
(defn sum-x
"desc"
<PropertyGroup>
<_EnableCleanOnBuildForMvcViews Condition=" '$(_EnableCleanOnBuildForMvcViews)'=='' ">true</_EnableCleanOnBuildForMvcViews>
</PropertyGroup>
<Target Name="CleanupForBuildMvcViews" Condition=" '$(_EnableCleanOnBuildForMvcViews)'=='true' and '$(MVCBuildViews)'=='true' " BeforeTargets="MvcBuildViews">
<ItemGroup>
<_TempWebConfigToDelete Include="$(BaseIntermediateOutputPath)**\Package\**\*" />
<_TempWebConfigToDelete Include="$(BaseIntermediateOutputPath)**\TransformWebConfig\**\*" />
<_TempWebConfigToDelete Include="$(BaseIntermediateOutputPath)**\CSAutoParameterize\**\*" />
<_TempWebConfigToDelete Include="$(BaseIntermediateOutputPath)**\TempPE\**\*" />
</ItemGroup>
Import-Module ActiveDirectory
# List members of a group
Get-ADGroupMember "Domain Admins" -recursive | Select-Object name
# list group memberships for user
Get-ADPrincipalGroupMembership "username" | Select-Object name
let date year month day = new System.DateTime(year, month, day)
type DayOfWeek = | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday
exception DayOfWeekError
let dayOfWeek (date: System.DateTime) =
match date.DayOfWeek with
| System.DayOfWeek.Monday -> Monday
| System.DayOfWeek.Tuesday -> Tuesday
let combine ys xs =
let zipi x = ys |> List.map (fun y -> (x, y))
xs |> List.collect zipi