This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Configuration; | |
using System.Diagnostics; | |
using System.IO; | |
namespace DifftoolStarter | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function zzz { | |
$source = @" | |
[DllImport("powrprof.dll")] | |
public static extern void SetSuspendState(bool hibernate, bool forceCritical, bool disableWakeEvent); | |
"@ | |
$app = Add-Type -Namespace "Standby" -MemberDefinition $source -Name Sleep -PassThru; | |
$app::SetSuspendState($false,$true,$false); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public decimal GetTaxes(decimal salary) | |
{ | |
decimal tax = 0; | |
var progressiveTaxation = new[] { 0.1m, 0.14m, 0.23m, 0.3m, 0.33m, 0.45m }; | |
var progressionSlices = new[] { 5070 - 0, 8660 - 5070, 14070 - 8660, 21240 - 14070, 40230 - 21240, decimal.MaxValue }; | |
var progression = 0; | |
while (salary > 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using FubuMVC.Core; | |
namespace CharmSim.Controllers | |
{ | |
public class HelpController | |
{ | |
public HelpViewModel Start() | |
{ | |
return new HelpViewModel { Title = "Hello from Controller! " }; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
using System.Windows; | |
using System.Windows.Controls.Primitives; | |
using System.Windows.Input; | |
using System.Windows.Interop; | |
/// <summary> | |
/// Popup with code to not be the topmost control |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows.Input; | |
namespace Something | |
{ | |
public class RelayCommand : ICommand | |
{ | |
private readonly Func<object, bool> _canExecute; | |
private readonly Action<object> _execute; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$a = pwd | |
ls -r | | |
? { !$_.name.Contains(".g.") } | | |
? { $_.Extension -eq ".cs" -or $_.Extension -eq ".csproj" } | | |
? { $_.lastwritetime -gt [DateTime]::Now.AddHours(-6) } | | |
% { | |
$relative = $_.fullname.Replace($a.Path + "\","") | |
$Path = [System.IO.Path]::GetDirectoryName($relative) | |
mkdir c:\temp\$path -erroraction SilentlyContinue | |
Copy-Item -path $relative -destination c:\temp\$path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Net; | |
using System.Text; | |
using System.Web; | |
public class HttpFileServer : IDisposable | |
{ | |
private readonly string rootPath; | |
private const int bufferSize = 1024*512; //512KB |
NewerOlder