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
<?php | |
/* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2014 Christopher Tombleson <chris@cribznetwok.com> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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 void GenerateNewPassword(PasswordOptions opts = null) | |
{ | |
#region Generating New Password | |
if (opts == null) opts = new PasswordOptions() | |
{ | |
RequiredLength = 12, | |
RequiredUniqueChars = 4, | |
RequireDigit = true, | |
RequireLowercase = true, | |
RequireNonAlphanumeric = true, |
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
- **BadRequest()**: Creates a BadRequestResult object with status code 400. | |
- **Conflict()**: Creates a ConflictResult object with status code 409. | |
- **Content()**: Creates a NegotiatedContentResult with the specified status code and data. | |
- **Created()**: Creates a CreatedNegotiatedContentResult with status code 201 Created. | |
- **CreatedAtRoute()**: Creates a CreatedAtRouteNegotiatedContentResult with status code 201 created. | |
- **InternalServerError()**: Creates an InternalServerErrorResult with status code 500 Internal server error. | |
- **NotFound()**: Creates a NotFoundResult with status code404. | |
- **Ok()**: Creates an OkResult with status code 200. | |
- **Redirect()**: Creates a RedirectResult with status code 302. | |
- **RedirectToRoute()**: Creates a RedirectToRouteResult with status code 302. |
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 class ValuesController : Controller | |
{ | |
private readonly IMimeMappingService _mimeMappingService; | |
public ValuesController(IMimeMappingService mimeMappingService) | |
{ | |
_mimeMappingService = mimeMappingService; | |
} | |
[HttpGet] |
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 RestSharp; | |
using System.Net; | |
using System.Net.Http; | |
public static void useRestSharp(string url) | |
{ | |
var client = new RestClient(url); | |
var request = new RestRequest(Method.POST); | |
request.AddHeader("Content-Type", "application/json"); |
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
<?php | |
class config | |
{ | |
private static $instance; | |
public function __construct() | |
{ | |
self::$instance = $this->dbConnect(); | |
} |
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
// Install System.Data.DataSetExtensions from NUGET | |
using System; | |
using System.Linq; | |
using System.Data; | |
public class newClass | |
{ | |
public object DataTableToObject() | |
{ |
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
SELECT | |
name, | |
base_object_name, | |
type | |
FROM | |
sys.synonyms | |
ORDER BY | |
name; | |
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
CREATE FUNCTION dbo.fn_recurringDates( | |
@wkDayPattern tinyint=127, --- 1=Mon, 2=Tue, 4=Wed, ... 127=All | |
@dayFrequency tinyint=1, --- 1=All, 2=every second, ... | |
@exactDay tinyint=NULL, --- Specific day number of the month | |
@occurrenceNo tinyint=NULL, -- 1=First, 2=Second, ... 0=Last | |
@occurrenceType tinyint=NULL, -- ... of 1=Week, 2=Month, 3=Year | |
@weekFrequency tinyint=1, --- 1=Every week, 2=Every second, etc | |
@exactWeek tinyint=NULL, -- Specific ISO week of the year |
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
// Install System.Data.DataSetExtensions from NUGET | |
using System; | |
using System.Linq; | |
using System.Data; | |
public class newClass | |
{ | |
public object DataSetToObject() | |
{ |
OlderNewer