This file contains 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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace QRCode | |
{ | |
/// <summary> | |
/// The valid encoding options able to be passed to the QR object |
This file contains 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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConDecon | |
{ | |
class Car | |
{ |
This file contains 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.Collections.Generic; | |
using System.Linq; | |
using System.Net.Mail; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace MailChecking | |
{ | |
class Program |
This file contains 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.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace IPfreely | |
{ | |
class Program |
This file contains 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 class TimeSpanExtensions | |
{ | |
private enum TimeSpanElement | |
{ | |
Millisecond, | |
Second, | |
Minute, | |
Hour, | |
Day | |
} |
This file contains 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
namespace YourProject.Models | |
{ | |
public class RequiresAuthenticationAttribute: ActionFilterAttribute | |
{ | |
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
string LoginPath = "/Login"; // Path to your login page | |
// Check authentication | |
Authentication auth = new Authentication(); |
This file contains 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 abstract class GlobalController : Controller { | |
public GlobalController() { | |
ViewData["AvailableEverywhere"] = "This information is available throughout the application!"; | |
} | |
} | |
/* USAGE */ | |
public class HomeController : GlobalController { | |
} | |
This file contains 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
namespace System { | |
/// <summary> | |
? /// Convert a day of the month into one with a suffix attached | |
/// </summary> | |
/// <requires> | |
/// A string representing the correct suffix for a given day of the month | |
/// </requires> | |
public static string ToStringWithSuffix(this DateTime dt, string format) { | |
// The format parameter MUST contain [$suffix] within it, which will be replaced. | |
int day = dt.Day; string suffix = ""; |
This file contains 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 class FormattableObject | |
{ | |
/// Takes a string and applies a "cleanup" filter on it. | |
/// Returns a Family friendly string of text with any bad words replaced with | |
/// the same number of characters, only as asterisks. | |
/// Usage: myString.ToFamilyFriendlyString() | |
private static List FilteredWords() | |
{ |