This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: default | |
--- | |
<h2 class="post_title">{{page.title}}</h2> | |
<ul> | |
{% for post in site.posts %} | |
{% for category in post.category %} | |
{% if category == page.category %} | |
<li class="archive_list"> | |
<time datetime='{{post.date | date: "%Y-%m-%d"}}'>{{post.date | date: "%m/%d/%y"}}</time> <a class="archive_list_article_link" href='{{post.url}}'>{{post.title}}</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -ne 2 ]; then | |
echo "Usage: $0 file partSizeInMb"; | |
exit 0; | |
fi | |
file=$1 | |
if [ ! -f "$file" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def paginate(scope, default_per_page = 20) | |
collection = scope.page(params[:page]).per((params[:per_page] || default_per_page).to_i) | |
current, total, per_page = collection.current_page, collection.num_pages, collection.limit_value | |
return [{ | |
pagination: { | |
current: current, | |
previous: (current > 1 ? (current - 1) : nil), | |
next: (current == total ? nil : (current + 1)), |