Skip to content

Instantly share code, notes, and snippets.

View travisfont's full-sized avatar
🍇
// = Earthberries !!

Travis van der F. travisfont

🍇
// = Earthberries !!
View GitHub Profile

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@travisfont
travisfont / README.md
Last active March 13, 2024 17:46 — forked from liitfr/README.md
[how to revert 100644 → 100755 commits ?] #git #chmod

how to revert 100644 → 100755 commits

  • on your repo's root, run : find . -type f -print0 | xargs -0 chmod -x
  • commit this change on files : commit -n -m 'fix: files permission from 100755 to 100644'
  • then with vim .git/config, set filemode option to false
[core]
        filemode = false
@travisfont
travisfont / TF-CLI.md
Last active June 21, 2023 12:48
Command Line Archive
@travisfont
travisfont / .jshintrc.js
Last active June 17, 2019 12:00 — forked from connor/.jshintrc.js
jshintrc example [updated]
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
"esversion" : 6, // allowing ES6
// Predefined globals whom JSHint will ignore.
@travisfont
travisfont / because.txt
Created August 27, 2018 13:09
Useless phases for code testing.
Here I am.
Bam, like a cheesecake.
@travisfont
travisfont / excerpt.php
Created June 11, 2018 11:46 — forked from wpscholar/excerpt.php
Generate an excerpt from provided content. Strips HTML, removes trailing punctuation and adds a 'more' string when text has been removed.
<?php
/**
* Get an excerpt
*
* @param string $content The content to be transformed
* @param int $length The number of words
* @param string $more The text to be displayed at the end, if shortened
* @return string
*/
@travisfont
travisfont / wp-get_id_by_slug
Last active June 11, 2018 10:26 — forked from lcdsantos/wp-get_id_by_slug
WordPress: Get page ID from slug
// Usage:
// get_id_by_slug('any-page-slug');
function get_id_by_slug($page_slug) {
$page = get_page_by_path($page_slug);
if ($page) {
return $page->ID;
} else {
return null;
}
@travisfont
travisfont / search_string_allocator.php
Created March 28, 2018 15:29
PHP Search Function to add to eephplib
<?php
function search_string_allocator($search_string, $safe_length = 3)
{
$search_string = strtolower(trim($search_string));
if (strlen($search_string) >= $safe_length)
{
$removals = array
(
@travisfont
travisfont / gist:029b37713de3fca3aac52365450b8442
Created December 5, 2017 16:37
MySQL: Get Custom Post Type & Custom ACF by Post Name
ID post_author post_date post_date_gmt post_content post_title post_excerpt post_status comment_status ping_status post_password post_name to_ping pinged post_modified post_modified_gmt post_content_filtered post_parent guid menu_order post_type post_mime_type comment_count
------ ----------- ------------------- ------------------- ------------ ------------------ ------------ ----------- -------------- ----------- ------------- ----------------- ------- ------ ------------------- ------------------- --------------------- ----------- --------------------------------------------------- ---------- --------- -------------- ---------------
2348 4 2017-11-29 09:33:03 2017-11-29 09:33:03 Travis Test publish closed closed travis-test 2017-11-29 09:36:09 2017-11-29 09:36:09
@travisfont
travisfont / WP_Wrapper.php
Created August 11, 2017 15:29
Work-in-Process: Simple small WordPress Wrapper to make Plugin and Hook programming more object oriented.
namespace WP_Wrapper
{
abstract class Options
{
// wp-includes/option.php
public static function update($option, $value, $autoload = NULL)
{
return update_option($option, $value, $autoload);
}