Skip to content

Instantly share code, notes, and snippets.

View schuyberg's full-sized avatar

Schuyler Lindberg schuyberg

  • The University of British Columbia
  • Vancouver, BC
View GitHub Profile
@SimonSimCity
SimonSimCity / pagination.html.twig
Last active May 16, 2025 07:13
A gist for pagination in Twig, based on the total number of pages, the current page and some URL-settings.
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <[email protected]>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
@james2doyle
james2doyle / ProvinceState Arrays
Created November 8, 2012 16:51
PHP array for states and Provinces in Canada and the US
$provinces = array(0 => 'Alberta',
1 => 'British Columbia',
2 => 'Manitoba',
3 => 'New Brunswick',
4 => 'Newfoundland and Labrador',
5 => 'Northwest Territories',
6 => 'Nova Scotia',
7 => 'Nunavut',
8 => 'Ontario',
9 => 'Prince Edward Island',
@kronda
kronda / selenium
Created October 13, 2012 02:51
Bash file for starting and stopping Selenium server
#!/bin/bash
SELENIUM=/usr/local/bin/selenium-server.jar
LOG=/var/log/selenium.log
PIDFILE=/opt/bin/selenium.pid
ARG=$1
if [ ${#ARG} -lt 1 ]
then echo "\nUSAGE: $0 {start|stop}\n"