Skip to content

Instantly share code, notes, and snippets.

View ashkanRmk's full-sized avatar
:octocat:
Doing what makes me happy!

Ashkan Rahmani ashkanRmk

:octocat:
Doing what makes me happy!
View GitHub Profile
@Azaferany
Azaferany / Program.cs
Created June 1, 2022 13:38
Microsoft RulesEngine Demo
using Newtonsoft.Json;
using RulesEngine.Models;
while (true)
{
string text = System.IO.File.ReadAllText(@"./workflow.json");
var workflowRules = JsonConvert.DeserializeObject<Workflow[]>(text);
var reSettings = new ReSettings()
{
@nainemom
nainemom / subtranslate.lua
Last active April 26, 2024 04:03
MPV script to translate current line of subtitle
-- Simple mpv script to translate subtitle using crow (online) or sdcv (offline) dictionaries.
-- INSTALLATION:
-- To install it, first install crow (https://crow-translate.github.io) and/or sdcv (http://dushistov.github.io/sdcv/) on your marchine with your favorite dicts and then,
-- copy this file to '~/.config/mpv/scripts/' (Linux) or '%AppData%\mpv\scripts\' (Windows).
-- sdcv help:
-- you can download offline dicts from http://download.huzheng.org/Quick/ (or anywhere else) and copy extracted dic folder to '~/.stardict/dic/'
-- CONFIGURATION:
local config = {
@AliMD
AliMD / AliMD-CSS-Layout-Debugger.md
Last active December 11, 2020 01:12
AliMD CSS Layout Debugger

CSS Layout Debugger AliMD Edition ;)

Outlines every DOM element on your page a random (valid) CSS hex color.

[].forEach.call($$('*'),el=>{el.style.outline=`1px solid hsl(${~~(Math.random()*360)},99%,50%)`})

screen shot 2018-02-10 at 2 01 00 pm

@yorek
yorek / OAuth2Middleware.cs
Last active December 14, 2021 05:50
ASP.NET Core 2 Custom OAuth2 Authentication
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.OAuth;
using Newtonsoft.Json.Linq;
@CodeMyUI
CodeMyUI / index.html
Created October 17, 2017 23:46
UI Motion – Shipping Concept
<!--
THIS IS ONE PART OF THREE
Check out the others here:
https://codepen.io/collection/DgggNa/
-->
public class VerticalTimelineDecoration extends RecyclerView.ItemDecoration {
Paint paintFill = null;
Paint paintStrokeFill = null;
Paint paintStroke = null;
Paint paintDotLine = null;
Paint paintText=null;
Paint paintTextBold=null;
@zerda
zerda / .gitlab-ci.yml
Last active August 8, 2023 07:52
Gitlab CI for ASP.Net Core project
stages:
- build
- publish
.build: &build_template
stage: build
image: microsoft/dotnet:2.1-sdk-alpine
cache:
key: "$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME"
paths:
@Prototype-X
Prototype-X / Install_pgAdmin4_with_python3_on_Ubuntu 16.04.md
Last active January 30, 2022 23:24
Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

Install pgAdmin4 v2.0 with python3 on Ubuntu 16.04 DESKTOP mode

  1. Get Python Wheel pgAdmin4

     wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v2.0/pip/pgadmin4-2.0-py2.py3-none-any.whl
    
  2. Install pip3

     sudo apt install python3-pip
    
@nerandell
nerandell / code-review-checklist.md
Last active May 21, 2024 17:43
PHP Code Review Guidelines

Make sure these boxes are checked before submitting/approving the PR

General

  • The code works
  • The code is easy to understand
  • Follows coding conventions
  • Names are simple and if possible short
  • Names are spelt correctly
  • Names contain units where applicable
  • There are no usages of magic numbers