This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Pagination generator | |
*/ | |
class Pagination | |
{ | |
private $items_per_page = 0; | |
private $items_total = 0; | |
private $mid_range = 7; | |
private $page_name = 'page'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Minimal tooltip for jQuery by Federico Ramirez | |
* | |
* Usage: $('#myElement').myPlugin({}); | |
* $('#myElement').myPlygin('myMethod', arg1, arg2); | |
* */ | |
;(function ($, window, document, undefined) { | |
'use strict'; | |
var pluginName = 'myPlugin', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ---------------------- USABILITY CONFIGURATION ---------------------- | |
" Basic and pretty much needed settings to provide a solid base for | |
" source code editting | |
" don't make vim compatible with vi | |
set nocompatible | |
" turn on syntax highlighting | |
syntax on | |
" and show line numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Object Oriented JS Utils | |
*/ | |
var oo = { | |
/** | |
* `methods` parameter is optional, if base is not | |
* defined assume it was defined in method's place, | |
* that way this method can be called as follows: | |
* | |
* `var Class = oo.extend(function () {}, BaseClass);` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* URYB parser. It transforms a list of tokens into an AST. | |
* | |
* Definitions: | |
* Atom/Terminal: Somthing which is a value itself | |
* Example: 1, "a string" | |
* | |
* Expression: Right hand side of an assignment | |
* Example: 1, "string", function_call(), array[1], mixed()[1] | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var debounce = function(func, wait, immediate) { | |
var timeout, args, context, timestamp, result; | |
var now = Date.now || function() { | |
return new Date().getTime(); | |
}; | |
var later = function() { | |
var last = now() - timestamp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var throttle = function (func, wait, options) { | |
var context, args, result; | |
var timeout = null; | |
var previous = 0; | |
if (!options) options = {}; | |
var later = function () { | |
previous = options.leading === false ? 0 : new Date().getTime(); | |
timeout = null; | |
result = func.apply(context, args); | |
if (!timeout) context = args = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim Finder plugin | |
" Wrapper around Vim's grep to make things easier | |
" Author: Federico Ramirez <[email protected]> | |
" Licence: MIT | |
" Give the user a chance to not load the plugin, also discard the possibility | |
" of loading it more than once | |
if exists("g:loaded_finder") | |
finish | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ---------------------- USABILITY CONFIGURATION ---------------------- | |
" Basic and pretty much needed settings to provide a solid base for | |
" source code editting | |
" don't make vim compatible with vi | |
set nocompatible | |
" turn on syntax highlighting | |
syntax on | |
" and show line numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
# RNB, A VIM COLORSCHEME TEMPLATE | |
# Author: Romain Lafourcade (https://github.com/romainl) | |
# Canonical URL: https://gist.github.com/romainl/5cd2f4ec222805f49eca | |
# This template is designed to help vimmers create their own colorschemes | |
# without much effort. | |
# | |
# You will need Ruby to generate your colorscheme but Ruby knowledge is | |
# not needed at all. |