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
<IfModule mod_headers.c> | |
# Enter possible domains and a cathcall regex for the subdomain. | |
SetEnvIf Origin "^http(s)?://(.+\.)?(domain1\.com|domain2\.com|domain3\.com)$" AllowOrigin=$0 | |
Header always set Access-Control-Allow-Origin "%{AllowOrigin}e" env=AllowOrigin | |
Header merge Vary "Origin" | |
Header always append Access-Control-Max-Age "1000" | |
Header always append Access-Control-Allow-Headers "X-Requested-With, Content-Type, Origin, Authorization, Accept, Accept-Encoding, \ | |
if-modified-since, pragma, cache-control" | |
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" |
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/sh | |
# | |
# This script will hold your hand during the process of converting an existing Drupal 7 file field from public to private. | |
# | |
# http://twitter.com/thsutton | |
# http://www.linkedin.com/pub/thomas-sutton/55/391/350 | |
# http://thomas-sutton.id.au/ | |
set -eu |
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/sh | |
#--------------------------------------------------------------------# | |
# Set OSX terminal window background color per SSH hosts. | |
#--------------------------------------------------------------------# | |
change_bgcolor () { | |
case $1 in | |
red) | |
osascript -e 'tell app "Terminal" to set background color of first window to {17655, 0, 0, -16373}';; |
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
#!/usr/bin/env sed -f | |
# whitespace at end of lines | |
s/\s\+$// | |
# fix comma followed by non-space character | |
# don't be picky, this is correct even for text! | |
/function/!s/\(,\)\(\S\)/\1 \2/g | |
# fix comments may not appear after statements |
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
#!/usr/bin/php | |
<?php | |
/** | |
* @file | |
* Git pre-commit hook that runs PHP lint and PHPCS against commits. | |
* DrupalCS requires PHPCS 1.x | |
* | |
* Install: | |
* 1. Copy this file to /<my/git/project>/.git/hooks/pre-commit |
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 php-eval 'node_access_rebuild();' |
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
""" | |
Queries the slowlog database table maintained by Amazon RDS and outputs it in | |
the normal MySQL slow log text format. Modified version of the script by | |
memonic (Thanks!) at https://gist.github.com/1481025 | |
Things to change in this script for your own setup: | |
<root_user> to your mysql root user (e.g. "root") | |
<root_pass> to your mysql root password (e.g. "hunter2") | |
<host_domain> to your mysql root password (e.g. "prod-01.w3rfs2.us-east-1.rds.amazonaws.com") |
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 | |
/** | |
* @file | |
* Amazon Elastic Load Balancer Settings. | |
* | |
* Force server to use https:// path if SSL is handled at load balancer. | |
* | |
* @see http://drupal.org/node/185161#comment-5452038 | |
*/ |
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
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"route53:ChangeResourceRecordSets", | |
"route53:GetHostedZone", | |
"route53:ListResourceRecordSets" | |
], | |
"Effect": "Allow", | |
"Resource": [ |
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 | |
# Set $chostname to current hostname | |
chostname=$(cat /etc/hostname) | |
# Display current hostname | |
echo "Current hostname is '$chostname'" | |
# Set $newhostname as new hostname | |
echo "Enter new hostname: " |