Skip to content

Instantly share code, notes, and snippets.

View airled's full-sized avatar

Uladzimir airled

  • Minsk, Belarus
View GitHub Profile
@DmitryTsepelev
DmitryTsepelev / 0_README.md
Last active April 19, 2025 06:19
Terminal–based game tutorial

Sources for my blog post about terminal–based game

@nega0
nega0 / iptables_color.txt
Last active June 14, 2024 11:24
colorize your `iptables` output
## based on the blogpost here: http://blog.sjas.de/posts/colored-iptables-output.html
iptables --line-numbers -vnL |\
sed -E 's/^Chain.*$/\x1b[4m&\x1b[0m/' |\
sed -E 's/^num.*/\x1b[33m&\x1b[0m/' |\
sed -E '/([^y] )((REJECT|DROP))/s//\1\x1b[31m\3\x1b[0m/' |\
sed -E '/([^y] )(ACCEPT)/s//\1\x1b[32m\2\x1b[0m/' |\
sed -E '/([ds]pt[s]?:)([[:digit:]]+(:[[:digit:]]+)?)/s//\1\x1b[33;1m\2\x1b[0m/' |\
sed -E '/([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}(\/([[:digit:]]){1,3}){0,1}/s//\x1b[36;1m&\x1b[0m/g' |\
sed -E '/([^n] )(LOGDROP)/s//\1\x1b[33;1m\2\x1b[0m/'|\
@maxivak
maxivak / readme.md
Last active November 10, 2024 12:19
sitemap.xml for Rails 4 application

Generate sitemap.xml in Rails app

This post shows how to make sitemap.xml for your web site. The sitemap will be accessible by URL http://mysite.com/sitemap.xml

Routes

Myrails::Application.routes.draw do
@cfc1020
cfc1020 / look_and_say.rb
Last active March 22, 2021 12:24
ruby look and say sequence 1 11 21 1211
class String
def look_and_say_regexp
self.gsub(/(.)\1*/) { |match| "#{match.size}#{match[0]}" }
end
def look_and_say_chunk
self.chars.chunk { |c| c }.map { |c, arr| [arr.size, c] }.join
end
def look_and_say_manual
@tagrudev
tagrudev / gist:4276467
Created December 13, 2012 13:46
Add custom fonts to your rails application
##
Lets say we have YoloFont.otf
1. We add it to vendor/assets/fonts/ folder
2. Me personaly creates a file named fonts.css.scss in app/assets/stylesheets
In it I have
@font-face{
font-family: 'YoloFont';
@passcod
passcod / Gemfile
Created September 20, 2012 05:15
Padrino + Sidekiq = ♥
# ...
gem 'sidekiq'
# ...