Skip to content

Instantly share code, notes, and snippets.

View DannyNunez's full-sized avatar

Danny Nunez DannyNunez

View GitHub Profile
@DannyNunez
DannyNunez / functions.php
Created May 22, 2012 05:33 — forked from johnmegahan/functions.php
Extended Walker class for use with the Twitter Bootstrap toolkit Dropdown menus in Wordpress.
<?php
add_action( 'after_setup_theme', 'bootstrap_setup' );
if ( ! function_exists( 'bootstrap_setup' ) ):
function bootstrap_setup(){
add_action( 'init', 'register_menu' );
@DannyNunez
DannyNunez / breadcrumb.tpl.php
Created December 17, 2012 01:13
Override default Drupal breadcrumb variable with template. Just add this file to yours themes template folder.
<div class="breadcrumb"><?php print implode(' » ', $breadcrumb);?></div>
@DannyNunez
DannyNunez / equal-heights.js
Created December 17, 2012 02:33
Code snippet to make a div match the height of another div. Just change the div classes to match yours. .div-one = The div that needs to have it's height set via Jquery. .div-two = The div with the height that div-one needs to match.
// Drupal Version
(function ($) {
$(".div-one").css({'height':($(".div-two").height()+'px')});
})(jQuery);
//Standard JQuery
$(".div-one").css({'height':($(".div-two").height()+'px')});
@DannyNunez
DannyNunez / powershell-scripts.txt
Created December 17, 2012 15:59
Windows Power Shell - Get a list of all files with a certain string of text.
Get-ChildItem -recurse | Select-String -pattern "String of Text I am looking for" | group path | select name
// set equal height with 2 tags
function set_height(div1, div2){
var height1 = $(div1).height();
var height2 = $(div2).height();
if(height1 > height2){
$(div2).css('min-height',height1);
}else{
$(div1).css('min-height',height2);
}
}
Dir *.jpeg | rename-item -newname { $_.name -replace ".jpeg",".jpg" }
Dir *.php | rename-item -newname { $_.name -replace ".php",".html" }
@DannyNunez
DannyNunez / delete-all-files-of-type-recursive.ps1
Last active December 10, 2015 19:59
Delete all files of a type recursively
get-childitem C:\ *.htm -recurse | foreach ($_) {remove-item $_.fullname}
@DannyNunez
DannyNunez / set-and-include-from-server-root.php
Created January 9, 2013 15:23
Set variable for server root to include path globally to your sites.
<?php
$new_root = explode('/',$_SERVER['DOCUMENT_ROOT']);
array_pop($new_root);
include_once(implode('/',$new_root).'path to file');
?>
h1. Sublime Text 2 - Useful Shortcuts (PC)
Loosely ordered with the commands I use most towards the top. Sublime also offer "full documentation":http://www.sublimetext.com/docs/2/.
h2. Editing
| *Ctrl+C* | copy current line (if no selection) |
| *Ctrl+X* | cut current line (if no selection) |
| *Ctrl+⇧+K*| delete line |
| *Ctrl+↩* | insert line after |
# Install Dependencies
# sudo apt-get install build-essential
# sudo apt-get build-dep php5
sudo apt-get install libmysqlclient-dev mysql-client libcurl4-openssl-dev libgd2-xpm-dev libjpeg-dev libpng3-dev libxpm-dev libfreetype6-dev libt1-dev libmcrypt-dev libxslt1-dev bzip2 libbz2-dev libxml2-dev libevent-dev libltdl-dev libmagickwand-dev libmagickcore-dev imagemagick libreadline-dev libc-client-dev libsnmp-dev snmpd snmp libvpx-dev libxpm-dev libgmp3-dev libicu-dev libpspell-dev libtidy-dev freetds-dev unixodbc-dev librecode-dev libglib2.0-dev libsasl2-dev libgeoip-dev imagemagick libmagickcore-dev libmagickwand-dev
# Stop Apache
sudo service apache2 stop
# Cleanup Packages
sudo apt-get autoremove