Skip to content

Instantly share code, notes, and snippets.

View HectorBlisS's full-sized avatar
💭
Learning as a past time activity

BlisS HectorBlisS

💭
Learning as a past time activity
View GitHub Profile
@kinxori
kinxori / Random Emoji Generator using React.jsx
Last active May 14, 2023 08:33
Create Random Emoji Generator function. We are using React and fetching from "emoji-api.com". (updates every time your father component has a movement, not fixed yet 🥲)
import { useEffect, useState } from "react"; // Import your React hooks
const [emojiData, setEmojiData] = useState([]); // State variable to store the emoji data
const EmojiAPI = "https://emoji-api.com/emojis?access_key=👺Register to the page and generate your unique key👺"
//👺Atention here
useEffect(() => { // We use useEffect hook to fetch our API everytime our page loads
const fetchEmojiData = async () => {
const response = await fetch(EmojiAPI)
@AlexHenkel
AlexHenkel / conekta-expo-rn.jsx
Last active January 14, 2023 21:31
Render props component to use Conekta with Expo in React-native
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Constants } from 'expo';
import { WebView } from 'react-native';
import { CONEKTA_KEY } from 'react-native-dotenv';
class Conekta extends Component {
deviceId = Constants.deviceId.replace(/-/g, '');
tokenizeCard = card =>
@codeguy
codeguy / slugify.js
Created September 24, 2013 13:19
Create slug from string in Javascript
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}