Skip to content

Instantly share code, notes, and snippets.

View danilvalov's full-sized avatar

Danil Valov danilvalov

  • Handsome
  • Russia, Omsk
View GitHub Profile
@elfefe
elfefe / regex.md
Created April 14, 2023 12:20
Markdown regex

A regex by itself won't be sufficient to fully parse text into Markdown, as Markdown has a variety of syntax rules that can't be captured by a single regular expression. However, I can provide you with a set of regex patterns to help identify some common Markdown elements. You can use these patterns to build a parser or converter:

  1. Headers: ^(#{1,6})\s+(.+)$

  2. Bold text: \*\*(.+?)\*\*|__(.+?)__

  3. Italic text: \*(.+?)\*|_(.+?)_

  4. Strikethrough: ~~(.+?)~~

@wottpal
wottpal / date-formats.ts
Created April 18, 2019 15:10
Custom DateFormats & DateAdapter for Angular Material MatDatepicker using Day.js
import { Platform } from '@angular/cdk/platform';
import { NativeDateAdapter } from '@angular/material';
import * as dayjs from 'dayjs';
import 'dayjs/locale/de';
import * as customParseFormat from 'dayjs/plugin/customParseFormat';
import * as localizedFormat from 'dayjs/plugin/localizedFormat';
/**
* Custom Date-Formats and Adapter (using https://github.com/iamkun/dayjs)
@danilvalov
danilvalov / config.yml
Last active February 18, 2021 18:36
FlexGet Kinopoisk plugin
templates:
movies:
set:
path: /tmp/mnt/94E8B2B1E8B290CA/Torrents/download/DLNA/Movies
transmission:
host: ************
port: ****
username: *************
password: *************
email:
# -*- coding: utf-8 -*-
import requests
from time import sleep
from datetime import datetime
import json
import sys
database = {"admins":[],
"suggestions":{}
}
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream