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
"-------About----- | |
" I use this .vimrc and the accompanying git repo of plugins, | |
" colorschemes, and other config files on Windows Vista, | |
" Windows 7, Ubuntu 12.04, and Mac OSX 10.7 on a daily basis. | |
" | |
" Pull requests and comments welcome! | |
"------INSTALLATION--- | |
" $ git clone --recursive https://github.com/brycefisher/vimfiles.git ~/.vim |
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
# Security | |
Options -Indexes | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule \.bat$ - [R=404] | |
</IfModule> | |
# Leverage Browser Caching | |
<IfModule mod_expires.c> | |
# Enable Expirations |
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
alias gvim='/c/Program\ Files\ \(x86\)/Vim/vim73/gvim.exe ' | |
alias expl='explorer ' | |
alias ga='git add ' | |
alias gb='git branch ' | |
alias gc='git commit -m' | |
alias gp='git push' | |
alias gs='git status ' | |
alias dld='cd /d/MySQL/drupal && ./drupal-db-download.sh' |
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
<p>To setup this bookmarklet in your browser, you'll need to:</p> | |
<ol> | |
<li>Clone (or download) this gist using the information on this page</li> | |
<li>Fill in your username and password</li> | |
<li>Change the drupal_domain variable to the domain of your drupal install</li> | |
<li>(Possibly) change the path to the path to your drupal login form</li> | |
<li>Drag the link to your bookmark bar</li> | |
</ol> | |
<p>To use, simply click the bookmark anywhere on your drupal_domain.</p> | |
<a href="javascript: (function(){ var user = 'username', pw = 'password', path = '/user/login', drupal_domain = '.example.com', domain = window.location.host, frame = document.createElement('iframe'), frame_length = frames.length; if(domain.indexOf(drupal_domain) !== -1){ document.body.appendChild( frame ); frame.src = '//' + domain + path; frame.style.display = 'none'; setTimeout(function() { frames[frame_length].document.getElementById('edit-name').value = user; frames[frame_length].document.getElementById('edit-pass').value = pw; frames[fr |
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 | |
// Note this is NOT recursive. | |
function scan_dir_for_non_utf8($dir_path) { | |
if ($dir = opendir($dir_path)) { | |
echo "opening $dir_path"; | |
$files_scanned = 0; | |
while (($file = readdir($dir)) !== false) { | |
// Don't go up directory levels | |
if (in_array($file, array('.','..'))) | |
continue; |
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 | |
/** | |
* Like var_dump, but it prints out the whole expression "path" to the given string. | |
* | |
* @param mixed $haystack | |
* The object or array with many levels of nested arrays or objects containing your needle | |
* @param str $php_exp | |
* The php expression for the initial $haystack param | |
* @return str | |
* No return value. Prints output to stdout (assumed to be a browser). |
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
/** | |
* Create a nodequeue. | |
*/ | |
function _brightcove_marketing_solutions_create_nodequeue() { | |
$nodequeue = new stdClass; | |
// $nodequeue->api_version = 2; | |
$nodequeue->name = 'marketing_solutions_related_partners'; | |
$nodequeue->title = 'Marketing solutions - related partners'; | |
$nodequeue->subqueue_title = ''; | |
$nodequeue->size = 0; |
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 | |
$nids = array(1, 2, 3, 4, 5); | |
// This is the key piece to understand -- it creates as many placeholder as you want based on the length of $nids array. | |
$placeholders = implode(',', array_fill(0, count($nids), '%d')); | |
$results = db_query(" | |
select r.title | |
from {node_revisions} r | |
join {node} n |
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 | |
/** | |
* @file | |
* This is a drush script designed to create fake translations of the genera pages for development purposes ONLY. | |
* | |
* NOTE: | |
* ----- | |
* This file must be located somewhere inside the drupal root. | |
* | |
* USAGE: |
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 | |
//... | |
// Store the database credentials serialized in an environmental variable. | |
$db_creds = unserialize(getenv('DRUPAL_DB_CRED')); | |
$databases = array ( | |
'default' => | |
array ( | |
'default' => $db_creds, |
OlderNewer