Skip to content

Instantly share code, notes, and snippets.

View esergueev's full-sized avatar

Eugene Sergueev esergueev

View GitHub Profile
@esergueev
esergueev / .gitconfig
Created April 8, 2019 17:57 — forked from pfedotovsky/.gitconfig
Helpful git config options
[core]
editor = code --wait # set VS Code as default editor
quotepath = false # display cyrillic names properly
autocrlf = false # Windows only projects. Don't convert LF to CRLF and vice versa during commit & checkout. Read carefully https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
[pull]
rebase = true # pull = 'fetch + rebase' instead of 'fetch + merge'
[alias]
co = checkout # 'git co' instead of 'git checkout'
st = status # 'git st' instead of 'git status'
[fetch]
@esergueev
esergueev / postgres_queries_and_commands.sql
Created March 7, 2018 09:26 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@esergueev
esergueev / iterm2-solarized.md
Created November 25, 2017 12:30 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@esergueev
esergueev / AuthConfig.cs
Created August 2, 2016 06:23
Code review
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
ExpireTimeSpan = TimeSpan.FromDays(30),
SlidingExpiration = true,
Provider = new CookieAuthenticationProvider
{
OnValidateIdentity = async cookieCtx =>
{
var validator = DependencyResolver.Current.GetService<IAuthenticationSessionValidator>();
@esergueev
esergueev / DbConnectionPerformanceTests.cs
Last active February 10, 2016 14:06
DBConnection per request or per query
public class DbConnectionPerformanceTests
{
private readonly ITestOutputHelper _outputHelper;
public DbConnectionPerformanceTests(ITestOutputHelper outputHelper)
{
_outputHelper = outputHelper;
}
[Theory]
@esergueev
esergueev / PerformanceTester.cs
Created February 10, 2016 11:18
Micro Performance Testing Class
public class PerformanceTester
{
public TimeSpan TotalTime { get; private set; }
public TimeSpan AverageTime { get; private set; }
public TimeSpan MinTime { get; private set; }
public TimeSpan MaxTime { get; private set; }
public Action Action { get; set; }
public PerformanceTester(Action action)
{
@esergueev
esergueev / Implementation Details.md
Created November 2, 2015 14:17 — forked from p2/Implementation Details.md
SMART on FHIR Tech Overview

Implementation Details

We'll be addressing certain implementation details here.

Pregnancy & Breastfeeding

To be able to detect whether a woman is pregnant, we would expect a [Condition][res-condition] resource with start date, end date and the Snomed-CT code for patient currently pregnant (77386006) or one if its many child codes. There is also a code for possible pregnancy (102874004) that we can consider using, if it makes sense from HCA's side.

@esergueev
esergueev / 0-README.md
Created October 31, 2015 12:06 — forked from p2/0-README.md
🔥FHIR Condition with mutation Observation example

🔥FHIR DSTU-2 data representing sample patient 1's cancer diagnosis: IDC diagnosis with 3 tumor mutation tests, 2 of them positive.

FHIR Version

The current official FHIR version is DSTU-1. There is a new DSTU-2 ballot version for May 2015 that introduces some nice data model changes to be expected for DSTU-2. I propose using this ballot version for our pilot.

#################################################################################
##
## PostgreSQL unattended install
## Author: Stefan Prodan
## Date : 16 Oct 2014
## Company: VeriTech.io
################################################################################
Function Install-Postgres
{