Skip to content

Instantly share code, notes, and snippets.

View Bound3R's full-sized avatar
⚒️

Daniel Naranjo Bound3R

⚒️
View GitHub Profile
@Bound3R
Bound3R / genRandomCodes.js
Last active May 10, 2021 17:48
special function to create simple-codes (eg, sms validators or coupons)
const randomstring = require('randomstring');
const badWords = require('./profanity.js'); // array to get the "black-list"
function genRandomCodes(quantity, length) {
const codes = new Set();
while (codes.size <= quantity) {
let code = randomstring.generate(length, true);
// This conditional is the ´code´ when this contains profane language
@Bound3R
Bound3R / lazyloading.js
Created May 10, 2021 17:50
Vanilla Lazyload
// Progressive loading images
const imagesToLoad = document.querySelectorAll("img[data-src]");
const loadImages = (image) => {
image.setAttribute("src", image.getAttribute("data-src"));
image.onload = () => {
image.removeAttribute("data-src");
};
};
if ("IntersectionObserver" in window) {
@Bound3R
Bound3R / gist:543c51e5183d44515f0980d4e6287379
Created October 7, 2021 20:54
This is a method to setup úsh notifications key in expo projects
# The first thing to do is to confirm that the fcm key is uploaded in order to send the pushes correctly.
expo push:android:show
# If not configured, proceed to obtain it.
[url](https://stackoverflow.com/a/37427911/4020055)
# After we have the key, we proceed to configure it in expo
expo push:android:upload --api-key {fcm server key}

Este ejercicio te permitirá practicar algunos de los comandos básicos de Git, como:

git init
git add
git commit
git branch
git checkout
git merge
version: '3'
services:
mysql:
image: mysql:latest
container_name: docker-mysql
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_DATABASE: database_name
MYSQL_USER: my_username
@Bound3R
Bound3R / reorder.py
Created June 15, 2023 00:21
Spotify - mix old/new songs
import spotipy
from spotipy.oauth2 import SpotifyOAuth
# ID de la playlist que deseas reorganizar
playlist_id = ''
client_id = ''
client_secret = ''
redirect_uri = 'http://localhost:8000/callback/'
def find_repeated_tracks(tracks):
@Bound3R
Bound3R / app.js
Created June 24, 2023 14:01
session 24/6
import React, { useState, useEffect } from 'react';
import { StyleSheet, Text, View, ScrollView, FlatList } from 'react-native';
import axios from 'axios';
import { Card } from 'react-native-paper';
import { FlashList } from "@shopify/flash-list";
export default function App() {
const [loading, setLoading] = useState(true);
const [data, setData] = useState([]);