Skip to content

Instantly share code, notes, and snippets.

View CarlMungazi's full-sized avatar
🕵️‍♂️
Digging into source code...

Carl Mungazi CarlMungazi

🕵️‍♂️
Digging into source code...
View GitHub Profile
@CarlMungazi
CarlMungazi / source-code-links.md
Last active August 1, 2017 21:16
Blogs/articles about reading source code
@CarlMungazi
CarlMungazi / factorialize.md
Last active July 23, 2017 22:41
Factorialize a Number

Task: Return the factorial of the provided integer.

Pseudocode:

  • Get the integer value (n) as a parameter
    • If the the number is equal to 0
      • return 1
    • return the value of n multiplied by result of n - 1

Actual Code:

@CarlMungazi
CarlMungazi / palindrome.md
Last active November 24, 2016 20:05
FCC Bonfire - Check for Palindromes

Task: Write a function which returns true if the given string is a palindrome. Otherwise, return false.

Pseudocode:

  • Get the string value as a parameter
    • If the user has entered a string
      • Remove non-alphanumeric characters and make the string lowercase
      • Reverse the string
      • If the string is a palindrome
        • return the boolean value true
@CarlMungazi
CarlMungazi / string-reverse.md
Last active November 3, 2018 21:22
Many Ways To Split A String

Task: Reverse the provided string in as many different ways as possible.

Tests: All the solutions should pass the following tests:

  • "hello" should return a string.
  • "hello" should become "olleh".
  • "Howdy" should become "ydwoH".
  • "Greetings from Earth" should return "htraE morf sgniteerG"

Code:

1. All you need is one line of code

@CarlMungazi
CarlMungazi / reverse.js
Last active July 31, 2017 16:12
Scraping and reversing headlines with node.js
//require modules
var request = require('request');
var cheerio = require('cheerio');
var fs = require('fs');
//prepare to reverse those strings
function reverseString(str) {
return str
.split('') //split string into an array
.reverse() // reverse the array values