Skip to content

Instantly share code, notes, and snippets.

View sdanna's full-sized avatar

Steven D'Anna sdanna

View GitHub Profile
@sdanna
sdanna / Windows10-Setup.ps1
Created July 20, 2016 20:36 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@sdanna
sdanna / Win10-DisableLockScreen.ps1
Created May 15, 2016 22:26 — forked from NickCraver/Win10-DisableLockScreen.ps1
Disable the lock screen (the one before the password prompt) in Windows 10 for faster login and not dropping the first password character.
# Disable the Lock Screen (the one before password prompt - to prevent dropping the first character)
If (-Not (Test-Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization)) {
New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows -Name Personalization | Out-Null
}
Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization -Name NoLockScreen -Type DWord -Value 1 -Force
var extraData = new string[] {"ExtraData1", "ExtraData2", "ExtraData3"};
var foobar2 = new FooBar("Value1", extraData);
var extraData = new string[] {"ExtraData1", "ExtraData2", "ExtraData3"};
var foobar2 = new FooBar("Value1", extraData);
var foobar1 = new FooBar("Value1", "ExtraData1", "ExtraData2", ExtraData3");
public Foobar(string value, string displayName, params string[] extraData)
{
// Implementation
}
public Foobar(string value, params string[] extraData)
{
// Implementation
}
protected void Application_Start()
{
// Standard MVC Stuff goes here.
// Load config-r configuration file based on the environment appSetting
var environment = ConfigurationManager.AppSettings["Server.EnvironmentName"];
Config.Global.LoadScriptFile($"Web.{environment}.csx");
}
<appSettings>
<add key="Server.EnvironmentName" value="debug" />
</appSettings>
var myComponent = Config.Global.Get<CustomObject>("myComponent");
Debug.WriteLine(myComponent.Id); // 3
Debug.WriteLine(myComponent.Text); // Blah
@sdanna
sdanna / web.csx
Last active November 12, 2015 23:01
#r "bin\MyComponents.dll"
Add("myComponent", new MyComponents.CustomObject { Id = 3, Text = "Blah" });