Skip to content

Instantly share code, notes, and snippets.

View Dekorg's full-sized avatar
🌩️
Focusing

Dekorg

🌩️
Focusing
  • Tbilisi
  • 07:46 (UTC -12:00)
View GitHub Profile
@Dekorg
Dekorg / evilnames.cs
Created May 31, 2023 23:04 — forked from jaredpar/evilnames.cs
Evil async and await C# code
using System;
using System.Runtime.CompilerServices;
public class C {
async async await(await async) => await async;
}
[AsyncMethodBuilder(typeof(builder))]
class async {
public awaiter GetAwaiter() => throw null;

Component based CSS Architecture

Rules

  1. A component always consists of CSS and HTML (JS is optional)
  2. HTML and JS of a component are located in ComponentName.js
  3. Styles of a component are located in ComponentName.scss
  4. Each CSS class starts with the unique component name
  5. The HTML of each component only uses its own prefixed classes
  6. Components can use other components, but never overwrite their styles
@Dekorg
Dekorg / web.config
Created January 19, 2020 21:01 — forked from mkelley82/web.config
Web.config for vue-router to handle history mode / deep links on IIS (w/ custom 404 and 500 error pages)
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Handle History Mode and custom 404/500" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
@Dekorg
Dekorg / Http.js
Created January 5, 2020 17:40 — forked from dbshoupe/Http.js
Wrapper class for Axios in a Vue project that uses interceptor to inject token (stored using Vuex) into header for each request.
import axios from 'axios';
import store from "@/data/state"
class Http {
constructor() {
let service = axios.create({});
service.interceptors.request.use((config) => {
config.headers.common['x-access-token'] = store.state.token
return config
@Dekorg
Dekorg / service.js
Created January 5, 2020 15:49 — forked from paulsturgess/service.js
An example Service class wrapper for Axios
import axios from 'axios';
class Service {
constructor() {
let service = axios.create({
headers: {csrf: 'token'}
});
service.interceptors.response.use(this.handleSuccess, this.handleError);
this.service = service;
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Autofac;
namespace DotNetDesignPatternDemos.Behavioral.Observer.ContainerWireup
{
public interface IEvent {}
@Dekorg
Dekorg / GregYoung - Videos - Order
Created April 7, 2019 15:56 — forked from javierholguera/GregYoung - Videos - Order
Greg Young's CQRS Class: Domain Driven Design, CQRS, and Event Sourcing
Greg Young's CQRS Class: Domain Driven Design, CQRS, and Event Sourcing
Introduction - 1:40
1 - Bounded Contexts - 55:36
Bounded Contexts - 55:25
Greg 16 05 18 - 35:20
Layered Architecture? - 13:42
ApplicationServices - 28:56
Specifications - 12:49
Command Handlers - 46:20
@Dekorg
Dekorg / CloudFlareConnectingIpExtensions.cs
Created February 19, 2019 07:26 — forked from tpeczek/CloudFlareConnectingIpExtensions.cs
ASP.NET Core middleware for CloudFlare Connecting IP support
using System;
using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.HttpOverrides;
using Lib.AspNetCore.CloudFlareConnectingIp;
namespace Microsoft.AspNetCore.Builder
{
public static class CloudFlareConnectingIpExtensions
{
public static IApplicationBuilder UseCloudFlareConnectingIp(this IApplicationBuilder app)
@Dekorg
Dekorg / .editorconfig
Created February 19, 2019 06:55 — forked from kuhlenh/.editorconfig
Roslyn .NET OSS (WIP)
###############################
# Core EditorConfig Options #
###############################
root = true
# All files
[*]
indent_style = space
# Code files
@Dekorg
Dekorg / dotnetlayout.md
Created February 12, 2019 20:13 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/