Skip to content
View jrg94's full-sized avatar
๐Ÿ’
Watching hockey
๐Ÿ’
Watching hockey

Organizations

@TheRenegadeCoder

Block or report jrg94

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this userโ€™s behavior. Learn more about reporting abuse.

Report abuse
jrg94/README.md

Welcome to My Profile!

This week's code snippet, Longest Palindromic Substring in Javascript, is brought to you by Subete and the Sample Programs repo.

const [, , input] = process.argv;

const getLongestPalindromic = (string) => {
  if (!string) return;

  let longestPal = '';

  for (let i = 1; i < string.length; i++) {
    for (let j = 0; j < string.length - i; j++) {
      let possiblePal = string.substring(j, j + i + 1).toLowerCase();

      if (
        possiblePal === [...possiblePal].reverse().join('') &&
        possiblePal.length > longestPal.length
      )
        longestPal = possiblePal;
    }
  }

  return longestPal;
};

console.log(
  getLongestPalindromic(input) ||
    'Usage: please provide a string that contains at least one palindrome'
);

Below you'll find an up-to-date list of articles by me on The Renegade Coder. For ease of browsing, emojis let you know the article category (i.e., blog: โœ’๏ธ, code: ๐Ÿ’ป, meta: ๐Ÿ’ญ, teach: ๐ŸŽ)

Also, here are some fun links you can use to support my work.

An image of @jrg94's Holopin badges, which is a link to view their full Holopin profile


This document was automatically rendered on 2026-01-16 using SnakeMD.

Pinned Loading

  1. TheRenegadeCoder/sample-programs TheRenegadeCoder/sample-programs Public

    Sample Programs in Every Programming Language

    BASIC 620 632

  2. TheRenegadeCoder/how-to-python-code TheRenegadeCoder/how-to-python-code Public

    A collection of Jupyter Notebooks from the How to Python series

    Jupyter Notebook 88 30

  3. TheRenegadeCoder/SnakeMD TheRenegadeCoder/SnakeMD Public

    A markdown generation library for Python.

    Python 47 11

  4. TheRenegadeCoder/image-titler TheRenegadeCoder/image-titler Public

    An image title generator using The Renegade Coder style

    Python 17 6

  5. JuxtaMIDI JuxtaMIDI Public

    Pinpointing Mistakes in MIDI Practice Recordings

    JavaScript 16 2

  6. Orpheus Orpheus Public archive

    An adventure game with a focus on 3D audio

    Python 4