Skip to content

Instantly share code, notes, and snippets.

View raulillana's full-sized avatar
🚀
Working from #homefficestudio!

Raul Illana raulillana

🚀
Working from #homefficestudio!
View GitHub Profile
@raulillana
raulillana / sample.html
Last active September 30, 2015 23:08 — forked from seedprod/gist:1181262
WordPress Farbtastic Color Picker for Multiple Instances
<!-- WordPress Farbtastic Color Picker for Multiple Instances -->
<div style="position:relative;">
<input type="text" name="my-theme-options[color]" id="color" />
<input type="button" class="pickcolor button-secondary" value="<?php _e('Select Color') ?>">
<div class="colorpicker" style="z-index:100; position:absolute; display:none;"></div>
</div>
<script>
// Include this script in your JS related file
$('.pickcolor').click(function(e) {
@raulillana
raulillana / fd2svn.sh
Last active January 1, 2016 23:19
Folders to SVN migrator. Automatically migrates a folder structure of software versions to a SVN working copy and creates tags for each version. <3
#!/bin/bash
# activate logs
LOGERROR="/Users/activeuser/Desktop/bash_error.txt"
LOGEXEC="/Users/activeuser/Desktop/bash_exec.txt"
# print errors to logs
exec 1> $LOGEXEC
exec 2> $LOGERROR
@raulillana
raulillana / functions.php
Last active January 2, 2016 21:59 — forked from davemac/gist:3410174
WordPress remove unwanted dashboard items
<?php
add_action('wp_dashboard_setup', 'prefix_custom_dashboard_widgets');
/** remove unwanted dashboard items */
function prefix_custom_dashboard_widgets()
{
global $wp_meta_boxes;
// QuickPress
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
@raulillana
raulillana / sample.php
Last active August 29, 2015 13:55
WordPress query_posts with custom posts_per_page and pagination
<?php
/**
* WordPress query_posts with custom posts_per_page and pagination
*/
if( get_query_var('paged') ) $paged = get_query_var('paged');
elseif( get_query_var('page') ) $paged = get_query_var('page');
else $paged = 1;
if( !is_paged() ) $offset = '';
elseif( $paged == 2 ) $offset = '&offset=11';
@raulillana
raulillana / fd2gh.sh
Last active August 29, 2015 13:56
Automatically migrates a folder structure of software versions to a GitHub working copy and creates tags for each version. FOLDERS 2 GITHUB #fd2gh <3
#!/bin/bash
# activate logs
LOGERROR="/Users/activeuser/Desktop/project-error_log.txt"
LOGEXEC="/Users/activeuser/Desktop/project-exec_log.txt"
# print errors to logs
exec 1> $LOGEXEC
exec 2> $LOGERROR
@raulillana
raulillana / recursive_folder_renamer.sh
Last active August 29, 2015 13:56
Bash script for recursive renaming folders only.
find -maxdepth 1 -type d -exec bash -c 'echo mv $0 ${0/changethis/forthis}' {} \;
@raulillana
raulillana / tml_types_profile_fix.php
Last active August 29, 2015 13:57
Types + TML Frontend Profile Fix. Little hack to make TML frontend profile page work with WPTypes custom fields.
<?php
add_action('init', 'types_tml_fix');
/** Types + TML frontend profile fix */
function types_tml_fix()
{
if( !is_admin() ) require WPCF_EMBEDDED_ABSPATH .'/admin.php';
}
?>
@raulillana
raulillana / functions.php
Created June 2, 2014 10:45
Disable PHP Strict Standards and Deprecated Notices the WordPress way.
<?php
// disable strict standards and deprecated notices
if( WP_DEBUG && WP_DEBUG_DISPLAY ) ini_set('error_reporting', E_ALL & ~E_STRICT & ~E_DEPRECATED);
?>
@raulillana
raulillana / loop.php
Last active August 29, 2015 14:04
Filter WP post_category Array in get_posts() loop.
<?php
$posts = get_posts();
foreach( $posts as $post ):
// filter post_category array
if( is_array($post->post_category) )
foreach( $post->post_category as $k => $v )
$post->post_category = $v;
endforeach;
@raulillana
raulillana / doge_git_aliases.sh
Last active August 29, 2015 14:04
Doge Git aliases (^ ● ω ●^)
$ alias wow="git init"
$ alias much=git
$ alias very=git
$ alias so=git
$ wow
$ so add .
$ very commit
$ much push