Skip to content

Instantly share code, notes, and snippets.

@perifer
perifer / ckeditor_settings.info
Created October 17, 2011 19:28
ckeditor module settings
name = CKEditor settings
description = Special settings for CKEditor/Wysiwyg module.
package = User interface
core = 7.x
dependencies[] = wysiwyg
@perifer
perifer / D6.php
Created June 13, 2011 07:40
"« 1 2 3 4 5 6 7 8 9 ... 44 »"-styled pager for Drupal.
<?php
/**
* Override default pager to get a pager with last and first page represented by numbers.
* E.g: « 1 2 3 4 5 6 7 8 9 ... 44 »
*/
function THEME_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9) {
global $pager_page_array, $pager_total;
// Calculate various markers within this pager piece:
// Middle is used to "center" pages around the current page.
/* $Id: styles.css,v 1.2 2008/01/16 11:45:00 fha Exp $ */
body {
padding: 33px 0 0 0;
margin: 0;
background: #fff url(bg_top00.gif) 0 0 no-repeat;
color: #333;
font: 12px arial, helvetica, verdana, sans-serif;
position: relative;
}
@perifer
perifer / simple_geo_geocode_example.inc.php
Created March 1, 2011 13:47
Converts addresses from a node and saves them as simple_geo positions, using the Google Geocoding API.
<?php
/**
* Converts addresses from a node and saves them as simple_geo positions, using
* the Google Geocoding API: http://code.google.com/apis/maps/documentation/geocoding/
*/
// Add this to a hook_menu:
// $items['admin/simple-geo/geocode-example'] = array(
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName plan.goodold.net
<IfModule mpm_itk_module>
AssignUserId plan plan
</IfModule>
DocumentRoot /home/plan/plan.goodold.net
<Directory /home/plan/plan.goodold.net>
@perifer
perifer / switch_collation.php
Created December 20, 2010 15:32
Script for change the collation of a database's table (utf8)
#!/usr/bin/env php
<?php
/**
* Script for change the collation of a database's table's
*/
if ($argv[1] == '-h') {
echo "Usage:\n\tphp collation_switch.php sql-user sql-password sql-database target-collation target-character\nExample: php collation_switch.php USER PASS DATABASE utf8_swedish_ci utf8\n";
die();
}
@perifer
perifer / todaystime.html
Created December 3, 2010 16:19
Bookmarklet to show todays reported time in Basecamp
<html>
<body>
Change the userID below and then drag the link to your bookmarks bar.
<a href="javascript:
var userID=3030954;
var domain='https://goodold.basecamphq.com';
var t=new Date();
var m=t.getMonth()+1;
<?php
class RunningRouteResource {
/**
* Creates a running route.
*/
public static function create($data) {
global $user;
<?php
/**
* Returns all the layers in the tile service.
*
* @return array
*/
function simplegeo_tileservice_get_layers() {
static $layers;
$cache_key = 'simplegeo_tileservice:layers';
> Lines beginning with `>` are comments.
> Comments and empty lines are ignored.
>
> Each command is defined on a single line comprised of:
>
> 1. a case-insensitive, alpha-numeric trigger followed
> by whitespace
> 2. a url followed by whitespace (if the url contains
> spaces they must be encoded as `%20`)
> 3. a short description