Skip to content
View ahafidi's full-sized avatar
Block or Report

Block or report ahafidi

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.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, 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
ahafidi/README.md

Hi there 👋

I'm a Web Developer & Cybersecurity Consultant

Driven by a profound passion for software and AI, I specialize in developing innovative solutions that prioritize user experience and data security. With a focus on simplifying processes and fostering empowerment, my work resonates at the intersection of technology and human-centric design in the digital era.


You can find me here: ahafidi.github.ioGitHubLinkedInTwitter

Pinned Loading

  1. Haskell — Prime numbers Haskell — Prime numbers
    1
    primes = filterPrime [2..] 
    2
      where filterPrime (p:xs) = 
    3
              p : filterPrime [x | x <- xs, x `mod` p /= 0]
  2. palindrome.js palindrome.js
    1
    const palindrome = str => {
    2
      const s = str.toLowerCase().replace(/[\W_]/g, '');
    3
      return s === s.split('').reverse().join('');
    4
    };
  3. map.js map.js
    1
    map = (fn, [head, ...tail]) => 
    2
      (head === undefined && tail.length < 1)
    3
        ? []
    4
        : [fn(head), ...map(fn, tail)]
  4. flattenDepth.js flattenDepth.js
    1
    const flattenDepth = (arr, depth = 1) =>
    2
      arr.reduce(
    3
        (acc, cv) => [
    4
          ...acc,
    5
          ...(depth === 0 || !Array.isArray(cv)
  5. some zip implementations some zip implementations
    1
    const zip = (...rows) =>
    2
      rows[0].map((_, i) => rows.map((row) => row[i]))
    3
    
    
    4
    const zip2 = (arr, ...arrs) =>
    5
      arr.map((val, i) => arrs.reduce((acc, cv) => [...acc, cv[i]], [val]))
  6. extractDuplicate.js extractDuplicate.js
    1
    const arr = [1, 2, 1, 2, 3, 3, 4, 5]
    2
    
    
    3
    arr.filter((e, i) => arr.indexOf(e) !== i)
    4
    // returns [1, 2, 3]