Skip to content

Instantly share code, notes, and snippets.

View deanpanayotov's full-sized avatar

Dean Panayotov deanpanayotov

  • Sofia, Bulgaria
View GitHub Profile
@Phlow
Phlow / jeykll-post-counter.liquid
Last active November 22, 2019 00:27
Counter: This code snippet just counts your jekyll posts and spits out the result
{% comment %}
*
* Counter: This include counts your jekyll posts
*
{% endcomment %}{% assign counter = 0 %}{% for item in site.posts %}{% unless item.published == false %}{% assign counter=counter | plus:1 %}{% endunless %}{% endfor %}{{ counter }}
@Phlow
Phlow / for-loop-sorted-collection
Last active April 30, 2024 13:30
This Liquid loop for Jekyll sorts a collection by date in reverse order
{% comment %}
*
* This loop loops through a collection called `collection_name`
* and sorts it by the front matter variable `date` and than filters
* the collection with `reverse` in reverse order
*
* To make it work you first have to assign the data to a new string
* called `sorted`.
*
{% endcomment %}
@opattison
opattison / jekyll-css-yaml-colors.css
Created August 28, 2013 01:11
How to use YAML front matter variables in a CSS file to define colors using variables in Jekyll, using Liquid tags. This example uses HSL colors with hex fallback colors. The goal here is to create standardized CSS with a color palette that can easily be extended to a whole file and maintained easily with only a few variables. The same thing cou…
---
white:
hsl: 'hsla(138, 10%, 98%, 1)'
hex: '#f9fafa'
black:
hsl: 'hsla(138, 16%, 10%, 1)'
hex: '#151e18'
green:
hsl: 'hsla(138, 39%, 54%, 1)'
hex: '#5cb777'
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs