Skip to content

Instantly share code, notes, and snippets.

View trolit's full-sized avatar

p4w31 !d21k0w541 trolit

View GitHub Profile
@trolit
trolit / extractCodeNesting.md
Created January 27, 2022 17:19
Extracts information about code structure that was passed as an string

Simple generic sample that allows to extract information about code structure which can be later analyzed in context of "whole part". See examples for demonstration.

/**
 * returns array that gives information about content structure **(based on curly brackets)**
 * @param {string} decoded_content decoded file content
 *
 * @example
 * 0 | 'module.exports = () => {'
 * 1 | 'if (condition1) {'
@trolit
trolit / liquid_essays_filtering.html
Last active October 18, 2020 14:54
Essays filtering by labels in Liquid language for Semantic UI select
<!--
Code snippet for adding essays filtering by labels
using Liquid language and Semantic UI for e.g. to
TechFolios portfolio http://techfolios.github.io/
-->
<!-- Single essay card example from TechFolios -->
<a class="grey card myessay" href="{{ site.baseurl}}{{ include.page.url }}">
@trolit
trolit / liquid_projects_counter.html
Last active October 18, 2020 15:04
Projects counter by used language in Liquid
<!--
Snippet for making projects counter for e.g. TechFolios portfolios, http://techfolios.github.io/
Example below assumes that there is property called 'language' on each project. However if
it doesn't, those projects with "nil" language will be skipped.
If you want to also count those "undefined" projects, remove lines: 23-25
and modify switch construction (case/when)
Projects counter uses iconify icons instead of raw languages names