Skip to content

Instantly share code, notes, and snippets.

import java.util.stream.IntStream;
import static java.lang.String.format;
class Sing99BottlesOfBeerOnTheWall {
private static final int TOTAL_BOTTLES = 100;
public static void main(String[] args) {
IntStream.rangeClosed(1, TOTAL_BOTTLES)
.map(i -> TOTAL_BOTTLES - i)
@mmonge
mmonge / category_prev_next_generator.rb
Created January 19, 2016 04:03
Jekyll Plugin Generator - Next and previous pagination by category
# A plugin to obtain category pagination with Jekyll
#
# Usage:
# <ul class="pagination">
# {% if page.blog_previous %}
# <li class="prev"><a href="{{ page.blog_previous.url | prepend: site.baseurl }}" title="{{ page.blog_previous.title }}">&laquo; Previous</a></li>
# {% else %}
# <li class="prev disabled"><a>&larr; Previous</a></li>
# {% endif %}
# <li><a href="{{ "/blog/" | prepend: site.baseurl }}">Blog</a></li>
@mmonge
mmonge / gist:2203106
Created March 26, 2012 04:57
Java EE 6 + RichFaces 4.2 + DataTable Parcial Render
<rich:dataTable var="v" value="#{bean.all}" id="table"
noDataLabel="No hay registros" rows="10"
styleClass="table table-striped">
<rich:column sortBy="#{v.codigo}" sortOrder="ascending"
filterValue="#{bean.codigoFilter}"
filterExpression="#{fn:containsIgnoreCase(v.codigo, bean.codigoFilter)}">
<f:facet name="header">
<h:panelGroup>