Skip to content

Instantly share code, notes, and snippets.

View joebasurto's full-sized avatar

Joe Basurto joebasurto

View GitHub Profile
<iframe width="0" height="1" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/xxxxxxxxx&color=%23800080&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
<?php
// Detect device
if(!function_exists('device_switch')){
function device_switch() {
$device = '';
if(stristr($_SERVER['HTTP_USER_AGENT'],'ipad')) {
$device = "ipad";
} else if(stristr($_SERVER['HTTP_USER_AGENT'],'iphone') || strstr($_SERVER['HTTP_USER_AGENT'],'iphone')) {
$device = "iphone";
@joebasurto
joebasurto / autoplay.js
Created July 2, 2019 02:05
YouTube Autoplay Fix (Chrome)
<script>
jQuery("video-iframe")[0].src += "&autoplay=1";
</script>
@joebasurto
joebasurto / .htaccess
Last active June 17, 2019 15:33
Wordpress Page to Sub-domain
RedirectMatch 301 ^/xxx/(.*)$ http://xxx.domain.com/$1
@joebasurto
joebasurto / flush_rewrites.php
Last active June 15, 2019 06:54
Wordpress - Rewrite Flush
<?php
// Flush Rewrites
register_activation_hook( __FILE__, 'myplugin_flush_rewrites' );
function myplugin_flush_rewrites() {
// call your rewrite rules registration function here (it should also be hooked into 'init')
myplugin_custom_rewrite_rules_registration();
flush_rewrite_rules();
}
?>
@joebasurto
joebasurto / .htaccess
Last active June 28, 2019 20:47
HTACCESS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@joebasurto
joebasurto / push.bat
Last active June 15, 2019 06:53
GIT Merge/Push BAT
:: Turn off print output string
ECHO OFF
:: Change title
title JBCreativFirm GIT Merge/Push
:: GIT branch algorithm
cls
git add .
git status
git commit -m "Default"
<?php
/*
* Searchable Ecwid products add to functions.php
*/
// Pre post hook, query modifier
add_filter('pre_get_posts', 'tgm_io_cpt_search');
// Modifier function
function tgm_io_cpt_search($query) {
if ($query->is_search) {
// Add ec-product post type; will also except other custom post types

Git Commit Messages

Git License: CC BY-NC 4.0

My standard git commit prefix message five character format. Keeping your git commit messages simple and clean allows for more important commits to stand out. More important commit messages can have any number of characters in prefix.

GIT

  • 5 letter attribute prefixes (as guidelines) for git commit messages:
    • Fixed
@joebasurto
joebasurto / README.md
Last active December 31, 2022 07:46
Blank README.md template.

[PROJECT NAME] | [SLOGAN]

release

This is a basic blank README for new projects.

Development

[COMPANY] | [SLOGAN]