cd ~/Projects
git clone https://github.com/facebook/xhprof.git xhprof.YOURDOMAIN
cd xhprof.YOURDOMAIN/extension
phpize
CFLAGS="-arch x86_64 -arch i386"
./configure
make
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 | |
/** | |
* 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( |
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
/* $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; | |
} |
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 | |
/** | |
* 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. |
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
name = CKEditor settings | |
description = Special settings for CKEditor/Wysiwyg module. | |
package = User interface | |
core = 7.x | |
dependencies[] = wysiwyg |
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 | |
/** | |
* Implementation of hook_preprocess(). | |
*/ | |
function manniskohjalp_preprocess(&$vars, $hook) { | |
// Static variable used for passing data from preprocess functions, | |
// e.g from preprocess-view to preprocess-page. | |
$manniskohjalp_shared = &drupal_static(__FUNCTION__, array()); | |
$vars['manniskohjalp_shared'] = $manniskohjalp_shared; | |
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
import sys | |
import os | |
import os.path | |
import re | |
import subprocess | |
import shutil | |
destination = "/Users/USER/Projects/SITE/public_html/sites/all/modules/feauters" | |
module = re.compile(r".*/(PREFIX)[^/]*.tar$") |
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
-- Munge emails and reset passwords. | |
UPDATE users SET mail = CONCAT(name, '@localhost'), init = CONCAT(name, '@localhost'), pass = 'pass'; | |
-- UPDATE authmap SET authname = CONCAT(aid, '@localhost'); | |
-- Remove irrelevant data that bulks up the dump and contains IP-addresses | |
TRUNCATE cache; | |
TRUNCATE cache_block; | |
TRUNCATE cache_bootstrap; | |
TRUNCATE cache_field; | |
TRUNCATE cache_filter; |
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 | |
// Drupal 6 | |
$settings_file = '/Users/anders/Projects/drupal-6.local/public_html/sites/default/settings.php'; | |
require($settings_file); | |
$parsed_db_url = parse_url($db_url); | |
$parsed_db_url['database'] = substr($parsed_db_url['path'], 1); | |
$parsed_db_url['password'] = $parsed_db_url['pass']; | |
$parsed_db_url['username'] = $parsed_db_url['user']; | |
$parsed_db_url['prefix'] = $db_prefix; |