Skip to content

Instantly share code, notes, and snippets.

View saip106's full-sized avatar

Sai Gudigundla saip106

  • Leancode Inc
  • Pittsburgh, PA
View GitHub Profile
@saip106
saip106 / start-new-javascript-project.cmd
Created January 8, 2019 01:43
create licence, gitignore, code of conduct and initialize git repo and npm
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
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))
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
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],
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('')];
@saip106
saip106 / Global.asax.cs
Created April 16, 2015 16:57
StructureMap Web API Bootstrapping
protected void Application_Start()
{
var container = new Container();
//Do registration here
var config = GlobalConfiguration.Configuration;
config.Services.Replace(typeof(IHttpControllerActivator), new ServiceActivator(config, container));
}
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;
}
@saip106
saip106 / .jshintrc.js
Last active August 29, 2015 14:05 — forked from connor/.jshintrc.js
Starter jshintrc
// 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`.