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
mkdir sites/default/files | |
chmod a+w sites/default/files | |
cp sites/default/default.settings.php sites/default/settings.php | |
chmod a+w sites/default/settings.php | |
// Goto the weburl and install | |
chmod go-w sites/default/settings.php | |
chmod go-w sites/default/services.yml |
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
SELECT (t1.nid + 1) as gap_starts_at, | |
(SELECT MIN(t3.nid) -1 FROM node t3 WHERE t3.nid > t1.nid) as gap_ends_at | |
FROM node t1 | |
WHERE NOT EXISTS (SELECT t2.nid FROM node t2 WHERE t2.nid = t1.nid + 1) | |
HAVING gap_ends_at IS NOT NULL |
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
sudo git clean -df && sudo git stash && git status |
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
#Goto the root of git repo | |
cd .git | |
sudo chgrp -R users . | |
sudo chmod -R g+rwX . | |
sudo find . -type d -exec chmod g+s '{}' + | |
git config core.sharedRepository group |
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 | |
drush sqlq "select type from node_type" | while read content_type; | |
do | |
echo "Changing comment settings for $content_type" | |
drush vset comment_default_mode_$content_type 0 | |
drush vset comment_default_per_page_$content_type 50 | |
drush vset comment_$content_type 2 | |
drush vset comment_form_location_$content_type 1 | |
drush vset comment_preview_$content_type 0 | |
drush vset comment_subject_field_$content_type 0 |
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
$view = new view(); | |
$view->name = 'testcomments'; | |
$view->description = ''; | |
$view->tag = 'default'; | |
$view->base_table = 'comment'; | |
$view->human_name = 'Test Comments'; | |
$view->core = 7; | |
$view->api_version = '3.0'; | |
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
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
drush sql-dump > project_dev1.$(date +%Y%m%d\-%H%M).sql | |
drush sql-dump > ${PWD##*/}-$(date +%Y-%m-%d\-%H-%M).sql |
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
sudo add-apt-repository ppa:git-core/ppa -y | |
sudo apt-get update | |
sudo apt-get install git | |
git --version |
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
var options = ''; | |
jQuery('.form-item-new-storage-type select option').each(function(){ | |
options = options + (jQuery(this).text() + '<<' + jQuery(this).val() + '\n'); | |
}); | |
console.log(options); | |
/** | |
* Copy paste the output from console.log to Google Spreadsheet | |
* You can use =SPLIT(A1,"<<"); function to split the key value pairs. | |
* / |
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
/** | |
* Retrieves all the rows in the active spreadsheet that contain data and logs the | |
* values for each row. | |
* For more information on using the Spreadsheet API, see | |
* https://developers.google.com/apps-script/service_spreadsheet | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |