Skip to content

Instantly share code, notes, and snippets.

View Moro-Code's full-sized avatar
🎄
Advent of Code 2024!

Omar Nasr Moro-Code

🎄
Advent of Code 2024!
View GitHub Profile
@Moro-Code
Moro-Code / download-file.js
Created September 8, 2022 03:01 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@Moro-Code
Moro-Code / NextWithStoryBooks.md
Last active May 17, 2021 16:28
How to integrate Next with Storybooks

The Problem

Say you have the following component in your next js project

path: components/ProfileImage.js

import Image from "next/image";
import PropTypes from "prop-types";
@Moro-Code
Moro-Code / main.py
Created April 7, 2021 18:40
Add trello numbers to cards
import os
import urllib3
import json
from urllib.parse import urlencode
http = urllib3.PoolManager()
token = os.environ.get("TRELLO_TOKEN")
secret = os.environ.get("TRELLO_SECRET")
board_id = os.environ.get("TRELLO_BOARD")