Skip to content

Instantly share code, notes, and snippets.

View slavbar's full-sized avatar

Slava Barbarii slavbar

View GitHub Profile

Cacher API

The curl command to grab all your snippets from all libraries is:

curl -X GET \
 https://api.cacher.io/integrations/show_all \
 -H 'cache-control: no-cache' \
 -H 'x-api-key: [api_key]' \
 -H 'x-api-token: [api_token]'

Vue: Bread Crumbs done right

image

@slavbar
slavbar / notes.md
Last active February 17, 2020 14:27

Get URL last segment

function getDocumentName() {
    var pageUrl = window.location.pathname.split('/');
    var documentName = $.grep(
        pageUrl,
        function(segment) { return segment !== ''; })
            .pop();
 return documentName;
// MEDIA QUERY MANAGER
/*
[0 - 576]: Phone (is where our normal styles apply)
576 - 900: Tablet portrait (bp-sm)
900 - 1200: Tablet landscape (bp-md)
1200 - 1500: Desktop/Laptop (bp-lg)
1500px + : Big desktop (bp-xl)
$breakpoint argument choices:
- bp-sm
@slavbar
slavbar / notes.md
Last active October 27, 2019 11:35

a1jg9dwf7 (Small)

EasySharp extensions

DistinctBy

    public static IEnumerable<TSource> DistinctBy<TSource, TKey>(
      this IEnumerable<TSource> source,
      Func<TSource, TKey> keySelector)
    {