Skip to content

Instantly share code, notes, and snippets.

View lxmmxl56's full-sized avatar
🏠
Working from home

Matt lxmmxl56

🏠
Working from home
View GitHub Profile
@leonsmith
leonsmith / pagination_range.py
Last active July 6, 2020 17:22
Pagination range, used to limit huge pagination objects
from django import template
register = template.Library()
@register.filter
def pagination_range(obj, current=1, limit=10):
"""
Used with pagination page_range object when you have a lot of pages
@mediavrog
mediavrog / JapaneseCharacter.java
Last active August 26, 2020 09:03
Simple string conversion from Hiragana to Katakana and vice versa. Uses the JapaneseCharacter class from Duane J. May and combines it with a simple Utility class method to perform the actual conversion.
/**
* JapaneseCharacter contains static functions to do various tests
* on characters to determine if it is one of the various types of
* characters used in the japanese writing system.
* <p/>
* There are also a functions to translate between Katakana, Hiragana,
* and Romaji.
*
* @author Duane J. May <djmay@mayhoo.com>
* @version $Id: JapaneseCharacter.java,v 1.2 2002/04/20 18:10:24 djmay Exp $