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 static int FinancialMonth(DateTime date) | |
{ | |
int month = date.Month - 3; | |
if (date.Month <= 3) | |
{ | |
month = month + 12; | |
} | |
return month; | |
} |
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
$.fn.intcheck = function () { | |
return this.bind("keyup", function () { | |
this.value = this.value.replace(/[^0-9]/g, ''); | |
if (isNaN(this.value)) { | |
while (isNaN(this.value)) { | |
var len = this.value.length; | |
if (len < 1) break; | |
this.value = this.value.substring(0, len - 1); | |
} | |
} |
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
void Main() | |
{ | |
Process p = new Process(); | |
p.EnableRaisingEvents = true; | |
ProcessStartInfo pi = new ProcessStartInfo { UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true, FileName = "cmd.exe", Arguments = "/c dir /w" }; | |
p.Exited += delegate { | |
Console.WriteLine("--ExitCode--" + Environment.NewLine + p.ExitCode); | |
Console.WriteLine("--StandardOutput--" + Environment.NewLine + p.StandardOutput.ReadToEnd()); | |
Console.WriteLine("--StandardError--" + Environment.NewLine + p.StandardError.ReadToEnd()); | |
}; |
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
string controllerName = ViewContext.RouteData.GetRequiredString("controller"); | |
string actionName = ViewContext.RouteData.GetRequiredString("action"); |
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
void Main() | |
{ | |
Queue<string> directories = new Queue<string>(Directory.GetDirectories(@"C:\Windows\system32\")); | |
do | |
{ | |
string dir = directories.Dequeue(); | |
Console.WriteLine("Directory: " + dir); | |
try | |
{ | |
string[] subdirs = Directory.GetDirectories(dir); |
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
<table style="padding: 3px; background: #111; border-radius: 8px" cellspacing="4"> | |
<tr> | |
<td class="light" width="50" height="50" data-bg="#f8696b" style="background: #fff; border-radius: 25px;"> | |
</td> | |
</tr> | |
<tr> | |
<td class="light" width="50" height="50" data-bg="#f9e983" style="background: #fff; border-radius: 25px;"> | |
</td> | |
</tr> | |
<tr> |
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
class MyClass | |
{ | |
public static List<string> AgeRanges | |
{ | |
get | |
{ | |
int start = 10; | |
int end = 59; | |
int step = 5; | |
int i = start; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="RewriteUserFriendlyURL" stopProcessing="true"> | |
<match url="^(.*)$" /> | |
<conditions> | |
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="true" negate="true" /> | |
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="true" negate="true" /> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
#blocks | |
{ | |
position: relative; | |
} |
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
System.Globalization.NumberFormatInfo nfi = new CultureInfo(System.Threading.Thread.CurrentThread.CurrentCulture.LCID).NumberFormat; | |
nfi.CurrencyDecimalDigits = 0; | |
var formatted = string.Format(nfi, "{0:C}", 120); |
NewerOlder