The code samples are taken from
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
REM took from https://twitter.com/bitandbang/status/1082331715471925250 | |
npx license mit > LICENSE && npx gitignore node && npx covgen <email_address> && git init && npm init -y |
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 Person[] Get(SearchCriteria searchCriteria) | |
{ | |
using(var dbContext = new MyDbContext()) | |
{ | |
var query = dbContext.Persons; | |
if(!string.IsNullOrWhitespace(searchCriteria.FirstName)) | |
{ | |
query = query.Where(x => x.FirstName.Contains(searchCriteria.FirstName)); | |
} | |
if(!string.IsNullOrWhitespace(searchCriteria.Zipcode)) |
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 c.id, c.FirstName, c.LastName, c.LastModifiedDate, c.DateOfBirth, c.Gender, c.HomePhoneNumber, c.IsArchived, c.MiddleName, c.SSN, | |
a.StreetAddress as [Address], a.City, a.State, a.Zip, cl.ExternalId as ClientExternalId, cl.Name as ClientName | |
,(select top 1 value from Identifier where Identifier.ConsumerId = c.id and Identifier.IdentifierTypeId = @EmpiTypeId) as EmpiId | |
,(select top 1 value from Identifier where Identifier.ConsumerId = c.id and Identifier.IdentifierTypeId = @AbsentysTypeId) as AbsentysId | |
from Consumer c | |
inner join Address a on a.ConsumerId = c.Id | |
inner join Client cl on cl.Id = c.ClientId | |
where c.id in | |
( | |
select distinct max(C.Id) from Consumer c |
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 | |
[Limit22].[Id] AS [Id], | |
[Limit22].[FirstName] AS [FirstName], | |
[Limit22].[LastName] AS [LastName], | |
[Limit22].[DateOfBirth] AS [DateOfBirth], | |
[Limit22].[Gender] AS [Gender], | |
[Limit22].[SSN] AS [SSN], | |
[Limit22].[IsArchived] AS [IsArchived], | |
[Limit22].[ExternalId] AS [ExternalId], | |
[Limit22].[Name] AS [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
function swap(array, i, j){ | |
var temp = array[i]; | |
array[i] = array[j]; | |
array[j] = temp; | |
} | |
function findPermutationsInternal(array, start, end){ | |
var result = []; | |
if(start === end){ | |
return [array.join('')]; |
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
protected void Application_Start() | |
{ | |
var container = new Container(); | |
//Do registration here | |
var config = GlobalConfiguration.Configuration; | |
config.Services.Replace(typeof(IHttpControllerActivator), new ServiceActivator(config, container)); | |
} |
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
function create_empty_is_visited_matrix(numberOfRows, numberOfColumns) { | |
var result = []; | |
for(var i = 0; i < numberOfRows; i++) { | |
result[i] = []; | |
for(var j = 0; j < numberOfColumns; j++) { | |
result[i][j] = false; | |
} | |
} | |
return result; | |
} |
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
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension | |
{ | |
// Settings | |
"passfail" : false, // Stop on first error. | |
"maxerr" : 100, // Maximum error before stopping. | |
// Predefined globals whom JSHint will ignore. | |
"browser" : true, // Standard browser globals e.g. `window`, `document`. |