Skip to content

Instantly share code, notes, and snippets.

View mudasobwa's full-sized avatar
🐯
Feeding Cats

Alexei Matyushkin mudasobwa

🐯
Feeding Cats
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mudasobwa on github.
  • I am mudasobwa (https://keybase.io/mudasobwa) on keybase.
  • I have a public key whose fingerprint is A1CF 5FF7 B35E 1543 4485 5B94 3217 3A89 58B2 E700

To claim this, I am signing this object:

@mudasobwa
mudasobwa / fib-fact
Created March 13, 2015 06:03
Functional approach to function calls :: Proof of concept
#!/usr/bin/env ruby
require 'awesome_print'
# one case handler, like when in case statement
def whether condition, &cb
$conditions[condition] = cb
$conditions
end
@mudasobwa
mudasobwa / client-helpers.rb
Created December 11, 2013 06:27
Ruhoh plugin to generate post scaffold basing on directory of images.
# encoding: utf-8
require 'digest/md5'
require 'RMagick'
require 'rmagick/screwdrivers'
module Ruhoh::Resources::Pages
class Client
Help_Image = [
{
@mudasobwa
mudasobwa / plugins-views-helpers-paginator.rb
Last active December 29, 2015 19:39
Paginator helper for ruhoh, collapsing page links when there are a lot of posts.
module Ruhoh::Views::Helpers
module Paginator
# current_page is set via a compiler or previewer
# in which it can discern what current_page to serve
def paginator
per_page = config["paginator"]["per_page"] rescue 5
current_page = master.page_data['current_page'].to_i
current_page = current_page.zero? ? 1 : current_page
offset = (current_page-1)*per_page
@mudasobwa
mudasobwa / prompt_mudasobwa_setup.sh
Last active February 17, 2016 11:36
YA Theme for YADR
#
# Mudasobwa yadr theme.
#
# Based on Agnoster theme from https://gist.github.com/3712874
#
# NB! In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
# Authors:
# agnoster (original)