Skip to content

Instantly share code, notes, and snippets.

View jabaltorres's full-sized avatar

Jabal Torres jabaltorres

View GitHub Profile
@jabaltorres
jabaltorres / jt-data.json
Last active October 8, 2019 02:55
This is being used in web fun
{
"thumbnails": [
{ "client" : "Digital Meaning",
"description" : "Digital Meaning",
"role": "UI Design, Web Development",
"imgSrc" : "https://jabaltorres.com/assets/img/thumbnails/Digital-Meaning-thumbnail.png",
"linkHref" : "https://www.jabaltorres.com/digital-meaning/",
"extLink" : false
},
<?php
// JT Test - being used on demos/forms/forms.php
function validate_jt_test_form($jtMessage) {
$errors = [];
if(is_blank($jtMessage['name'])) {
$errors[] = "Name cannot be blank.";
} elseif(!has_length($jtMessage['name'], ['min' => 2, 'max' => 255])) {
$errors[] = "Name must be between 2 and 255 characters.";
}
@jabaltorres
jabaltorres / wp-display-image-captions.php
Created February 24, 2019 04:07
Display WP featured image captions and descriptions
<?php
/* Only display to logged in users */
if ( is_user_logged_in() ) {
/* Displaying the image caption and description */
$thumb_img = get_post( get_post_thumbnail_id() ); // Get post by ID
echo '<p>The Caption: ' . $thumb_img->post_excerpt . '<br>'; // Display Caption
echo 'The Description: ' . $thumb_img->post_content . '</p> '; // Display Description
/* Displaying the image alt text */
@jabaltorres
jabaltorres / wp-display-categories.php
Created February 24, 2019 03:55
How to display wordpress categories
<?php
// How to display categories
$args = array(
'taxonomy' => 'test',
'orderby' => 'name',
'order' => 'ASC'
);
$cats = get_categories($args);
@jabaltorres
jabaltorres / windows-commands.md
Last active January 19, 2019 18:47
List of windows commands
Command Decription
call calls a batch file from another one
cd change directory
cls clear screen
cmd start command prompt
color change console color
date show/set date
dir list directory content
echo text output
@jabaltorres
jabaltorres / lorem-grid.scss
Created February 27, 2018 06:17
Custom gird for wordpress development
.grid-container {
width :100%;
max-width: 1240px;
}
.grid-container {
box-sizing: border-box;
/*-- our cleafix hack -- */
.row:before,
.row:after {

Quick Command Reference

git add .
git git commit -m "init commit"
git remote add origin https://github.com/capitalJT/new-repo.git
git push origin master

Setup


@jabaltorres
jabaltorres / Contract Killer 3.md
Created May 27, 2017 04:48
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@jabaltorres
jabaltorres / Adaptive-Utility-Nav-Translated.html
Last active March 9, 2017 21:56
Adaptive Utility Nav Translated
<!-- US -->
<ul id="utilityNav">
<li><a class="narrow lang-link" href="/free-trial">Free Trial</a></li>
<li class="uPhone"><a href="tel:8003036346">800.303.6346</a></li>
<li class="uContact"><a href="/about/contact">Contact Us</a></li>
<li class="utilityNav-dropdown uLanguage">
<i class="fa fa-globe" aria-hidden="true"></i>
<span class="location">United States</span>
<ul class="utilityNav-dropdown-list ulangList">
<li><a href="/uk">United Kingdom</a></li>