Skip to content

Instantly share code, notes, and snippets.

View robinvdvleuten's full-sized avatar
🚀

Robin van der Vleuten robinvdvleuten

🚀
View GitHub Profile
@robinvdvleuten
robinvdvleuten / ckeditor_styles.module
Created February 24, 2012 16:15
Add your own styles to Drupal's WYSIWYG module
<?php
function ckeditor_styles_wysiwyg_editor_settings_alter(&$settings, &$context)
{
if ($context['profile']->editor == 'ckeditor') {
$settings['extraPlugins'] .= ',stylesheetparser';
// Not necessary but removes all default styles from the CKEditor.
$settings['stylesSet'] = array();
}
}
@robinvdvleuten
robinvdvleuten / template.php
Created February 23, 2012 11:43
Remove Drupal's core system stylesheets
<?php
/**
* Remove Drupal's core system stylesheets.
*/
function THEMENAME_css_alter(&$css)
{
$path_system = drupal_get_path('module', 'system');
$remove = array(
$path_system . '/system.base.css',
@robinvdvleuten
robinvdvleuten / wp-config.php
Created February 2, 2012 10:45
Multiple configuration files with Wordpress
<?php
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/** Load configuration based on the server's environment **/
$env = isset($_SERVER['ENVIRONMENT']) ? $_SERVER['ENVIRONMENT'] : 'dev';
require_once ABSPATH . 'wp-config/wp-config.' . strtolower($env) . '.php';
/** Sets up WordPress vars and included files. */
@robinvdvleuten
robinvdvleuten / gist:1554447
Created January 3, 2012 10:53
Zend Server useful commands
# Restart the Apache server
/usr/local/zend/bin/zendctl.sh restart
@robinvdvleuten
robinvdvleuten / gist:1210978
Created September 12, 2011 10:31
Usefull Mac Command
# Restart finder:
killall -KILL Finder
# Create symbolic links:
ln -s /Volumes/Classic/ Classic
# Remove .DS_Store recursively:
find . -name '*.DS_Store' -type f -delete
@robinvdvleuten
robinvdvleuten / upload-to-rackspace-cloud-file.sh
Created August 15, 2011 14:21 — forked from chmouel/upload-to-rackspace-cloud-file.sh
Upload to RackSpace CloudFiles from shell with curl.
#!/bin/bash
# Author: Chmouel Boudjnah <[email protected]>
# Not officially supported by Rackspace only as a best effort basis :)
# Define yes to make it to copy to url to clipboard (via a shortened url
# service) You need to have the software xclip installed in your system.
COPY_URL_TO_CLIPBOARD=yes
# Containers to ignore in the list
CONTAINERS_TO_IGNORE=".CDN_ACCESS_LOGS"
@robinvdvleuten
robinvdvleuten / gist:861848
Created March 9, 2011 07:53
jQuery - Check if element exists
$.fn.exists = function() {
return $( this ).length > 0;
}