This file contains hidden or 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
$ ssh [email protected] "drush --root=/path/in/remote/server sql-dump" | drush sql-cli |
This file contains hidden or 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 | |
$style = ''; | |
foreach($styles as $stylesheet) { | |
if (strpos($stylesheet['data'], 'system/system.menus.css') > 0) { | |
// Skip this one, at least for my theme. | |
continue; | |
} | |
// The following are nicked from Drupal core. | |
$contents = drupal_load_stylesheet($stylesheet['data'], TRUE); |
This file contains hidden or 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
function getLocationAndPost() { | |
'use strict'; | |
navigator.geolocation.getCurrentPosition(function (position) { | |
var url = 'http://example.com/enpoint' + '/node.json'; //endpoint URL | |
var lat = position.coords.latitude; | |
var lon = position.coords.longitude; | |
var date = new Date(); | |
var timestamp = Math.round(date.getTime() / 1000); | |
var node_object = { | |
"type": "some_type", //set this to your content type |
This file contains hidden or 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
#!/bin/bash | |
# Configuration | |
VHOST_CONF=/etc/apache2/sites-available/ | |
ROOT_UID=0 | |
WWW_ROOT=/var/www | |
MYSQL=`which mysql` | |
DRUSH=`which drush` | |
# If you don't use drush aliases, uncomment this. | |
DRUSHRC=/home/MYUSERNAME/.drush/aliases.drushrc.php |
This file contains hidden or 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
if (req.http.host == "crashndash.com") { | |
unset req.http.Cookie; | |
} |
This file contains hidden or 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 | |
print client_cache_styles($css); | |
print client_cache_scripts($scripts); |
This file contains hidden or 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 | |
if (variable_get('environment', '') == 'development') { | |
return; | |
} |
This file contains hidden or 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 | |
/** | |
* Implements hook_node_insert(). | |
*/ | |
function mymodule_node_insert($node) { | |
// The node type I am using is called 'order'. | |
if ($node->type == 'order') { | |
// I am using the body field for values. | |
$body = field_get_items('node', $node, 'body'); | |
$comp = explode("\n", $body[0]['value']); |
This file contains hidden or 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 | |
/** | |
* Implements hook_webform_component_presave(). | |
*/ | |
function mymodule_webform_component_presave(&$component) { | |
// Maybe I should do some more robust checking here, but this is a simple site | |
// and the body description clearly states how to format lines with links. | |
// Also, remember if you have other use cases for the webform, you should | |
// check that this is actually a webform created by above code! | |
if (strpos($component['name'], '(http') > -1) { |
This file contains hidden or 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 | |
print '<style>'; | |
$style = '' | |
foreach ($css as $c) { | |
// Do some checking of some media query stuff. | |
// ... | |
// Then store the raw CSS. | |
$style .= file_get_contents($c['data']); | |
} | |
//do some regex to remove some stuff, and remove whitespace. |
OlderNewer