Skip to content

Instantly share code, notes, and snippets.

View madhur's full-sized avatar
🎯
Focusing

Madhur Ahuja madhur

🎯
Focusing
View GitHub Profile
@phpdude
phpdude / nginx.conf
Last active February 28, 2024 04:36
Nginx image filter + caching of results.
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP

This is the code I use for the tag cloud at www.librador.com:

{% for tag in site.tags %}
  {% assign t = tag.first %}
  {% assign posts = tag.last %}
  <a class="tag tag{{ posts | size }}" href="/tags/#tag-{{ t | to_id }}">{{ t }}</a>
{% endfor %}

It expects there to be a CSS class called tag and several ones called tag1, tag2, tag3 etc, where the number is the number of posts with that tag. Here's my version: