Snipe.Net

Geeky, sweary things.

Latest stories

Truncate text to x number of words

T

This code will truncate given text to a certain length, adding “…” where it’s been truncated. For example: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque ac urna a erat pharetra placerat. Sed at tortor id lacus pellentesque malesuada. Suspendisse vitae dui vel velit tincidunt aliquet. Cras condimentum lobortis leo. Integer semper. Nunc semper felis a...

Google Style Page Numbering (with x per page and y page numbers displayed)

G

With just a few modifications, we can create a piece of code that will not only give you x results per page with page numbers, but it will also allow you to specify how many page numbers should appear on the page at any time, much like Google.  (For example, if you have hundreds of page numbers, this would look messy and cluttered – using this code, you can tell it to only display 5 page...

Snipe.Net Geeky, sweary things.

About Me

I’m a tech geek/dev/infosec-nerd/scuba diver/blacksmith/sword-fighter/crime fighter/ENTP/warcrafter/activist. I run Grokability, Inc, and run several open source projects, including Snipe-IT Asset Management. Tweet at me @snipeyhead or read more...

Get in Touch