Skip to content

Instantly share code, notes, and snippets.

@gosukiwi
gosukiwi / paginator.inc.php
Last active January 24, 2022 09:39
PHP Pagination generator
<?php
/**
* Pagination generator
*/
class Pagination
{
private $items_per_page = 0;
private $items_total = 0;
private $mid_range = 7;
private $page_name = 'page';
@latenitecali
latenitecali / timestamp.py
Last active December 28, 2015 13:29
Sublime Text 2 Plugin: Timestamp for creation date and last modified date, automatically added and updated.
"""
Automatically add and update time stamps in your files.
On file open, will replace [timeStamp] with the current date and time.
Currently looks for two instances of this (example below).
To use, place the text [timeStamp] in your template file where you want it.
ex.
// CREATED: timeStamp
// MODIFIED: timeStamp

#Discounts v1.0.0-alpha

A framework agnostic discount package featuring coupon/discount rule sets & conditions. Part of the Cartalyst Arsenal & licensed OSI BSD 3. Code well, rock on.

##Package Story

History and future capabilities.

####Incomplete

  • Discount::add(...) Can create a discount.
@pamelafox-coursera
pamelafox-coursera / CalendarHelper.class.php
Created April 10, 2013 23:09
Generate iCal files in PHP
<?php
class CalendarEvent {
/**
*
* The event ID
* @var string
*/
private $uid;
@btd
btd / jQuery.print.js
Created April 15, 2012 07:25
jQuery.print.js
// Create a jquery plugin that prints the given element.
jQuery.fn.print = function(){
// NOTE: We are trimming the jQuery collection down to the
// first element in the collection.
if (this.size() > 1){
this.eq( 0 ).print();
return;
} else if (!this.size()){
return;
}
@rcmachado
rcmachado / jquery.unserialize.js
Created November 25, 2009 10:19
$.unserialize for jQuery
/**
* $.unserialize
*
* Takes a string in format "param1=value1&param2=value2" and returns an object { param1: 'value1', param2: 'value2' }. If the "param1" ends with "[]" the param is treated as an array.
*
* Example:
*
* Input: param1=value1&param2=value2
* Return: { param1 : value1, param2: value2 }
*