Skip to content

Instantly share code, notes, and snippets.

View dpr-dev's full-sized avatar
🏠
Working from home

Arthur Irgashev dpr-dev

🏠
Working from home
View GitHub Profile
@dpr-dev
dpr-dev / example.cs
Created August 24, 2024 11:49
example
// usecase
class UseCaseX
{
private readonly UserCreator _userCreator;
private readonly UserRoleAssigner _userRoleAssigner;
public Task<ErrorOr<UserDto>> Execute(Input input)
{
var trx = beginTransaction();
var creationResult = await _userCreator.Create(new {...});
@dpr-dev
dpr-dev / cleanup-objbin.ps1
Created August 19, 2023 19:43 — forked from xtrmstep/cleanup-objbin.ps1
PowerShell script to delete all \bin and \obj folders
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
import 'package:flutter/material.dart';
class UserListScreen extends StatefulWidget {
@override
_UserListScreenState createState() => _UserListScreenState();
}
class _UserListScreenState extends State<UserListScreen> {
const bool isDarkModeEnabled = false;
final userList = [];
@dpr-dev
dpr-dev / gist:a9bf26f43a142c2f49230da9f21526b7
Created September 16, 2022 19:12 — forked from daominhsangvn/gist:f2d369ab4aafe9783e96fbe05285cfbd
Push Notifications in React-Native with FireBase
  1. Add new App in Firebase Console, select iOS and follow exactly instruction. 1a. In the GoogleService-Info.plist step, after download the file, open xCode, in Project Navigator right click Supporting folder and select Add files to ... then select the downloaded file.
  2. Following this to create App Id, APNs (.p8) and Provisioning Profile for iOS: https://firebase.google.com/docs/cloud-messaging/ios/certs 2a. Add APN file (.p8) to Firebase App
  3. Edit Podfile, add following below pod 'Firebase/Core': pod 'Firebase/Messaging' then $ pod install again
  4. Install react-native-fcm module then rnpm link react-native-fcm
  5. Following this https://github.com/evollu/react-native-fcm#shared-steps and this https://github.com/evollu/react-native-fcm#xcode-post-installation-steps
  6. Write Component to handle Push Notifications:
# main.js
const next = require('next');
const express = require('express');
const passport = require('passport');
const session = require('express-session');
const oidc = require('openid-client');
const cookieParser = require('cookie-parser');
const {
Issuer,
Strategy
@dpr-dev
dpr-dev / file.cs
Created July 19, 2020 06:29
get sql from ef core 3.1 queryable
public static class IQueryableExtensions
{
public static string ToSql<TEntity>(this IQueryable<TEntity> query) where TEntity : class
{
IEnumerator<TEntity> enumerator = query.Provider
.Execute<IEnumerable<TEntity>>(query.Expression)
.GetEnumerator();
object relationalCommandCache = enumerator.Private("_relationalCommandCache");
SelectExpression selectExpression = relationalCommandCache.Private<SelectExpression>("_selectExpression");
import * as React from 'react';
import { push, replace } from './router';
export type RouteValidationResult = {
url: string,
needRedirect: boolean,
state?: any,
replace?: boolean
};
@dpr-dev
dpr-dev / gist:9e61cb9d677fcc63a518feddcbf929eb
Created January 11, 2018 07:57
APPX4001: Build property AppxBundlePlatforms is not explicitly set and is calculated based on currently building architecture. Use 'Create App Package' wizard or edit project file to set it
=>
Add `AppxBundlePlatforms` section to .csproj
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
...
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
@dpr-dev
dpr-dev / README-Template.md
Created November 17, 2017 13:01 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@dpr-dev
dpr-dev / README.md
Created September 25, 2017 07:05 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha: