Skip to content

Instantly share code, notes, and snippets.

Avatar

Marvin M. mmonge

  • Costa Rica
View GitHub Profile
View Sing99BottlesOfBeerOnTheWall.java
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 Jan 19, 2016
Jekyll Plugin Generator - Next and previous pagination by category
View category_prev_next_generator.rb
# 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 Mar 26, 2012
Java EE 6 + RichFaces 4.2 + DataTable Parcial Render
View gist:2203106
<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>
You can’t perform that action at this time.