Skip to content

Instantly share code, notes, and snippets.

@eddiemoya
eddiemoya / boilerplate-widget.php
Last active March 4, 2020 16:36
WordPress Boilerplate Widget
<?php /*
Plugin Name: Boilerplate Widget
Description: Starting point for building widgets quickly and easier
Version: 1.0
Author: Eddie Moya
/**
* IMPORTANT: Change the class name for each widget
*/
class Boilerplate_Widget extends WP_Widget {
@eddiemoya
eddiemoya / print_pre.php
Last active October 5, 2015 15:47
Print Pre
<?php
function print_pre($array){
echo "<pre style='z-index:1000;background-color:rgba(192,192,192,0.9);left:0;top:100px;width:4000px;overflow:scroll;position:absolute;white-space: pre;'>";
print_r($array);
echo "</pre>";
}
@barraponto
barraponto / git-submodule-rm.sh
Created April 25, 2012 16:36
git submodule-rm
#!/bin/bash
function actual_path() {
if [ [ -z "$1" ] -a [ -d $1 ] ]; then
echo $(cd $1 && test `pwd` = `pwd -P`)
return 0
else
return 1
fi
}
@danielpietzsch
danielpietzsch / deploy.rb
Created March 10, 2011 22:50
Deploy a specific or the current Git branch by default using Capistrano
# parses out the current branch you're on. See: http://www.harukizaemon.com/2008/05/deploying-branches-with-capistrano.html
current_branch = `git branch`.match(/\* (\S+)\s/m)[1]
# use the branch specified as a param, then use the current branch. If all fails use master branch
set :branch, ENV['branch'] || current_branch || "master" # you can use the 'branch' parameter on deployment to specify the branch you wish to deploy