Skip to content

Instantly share code, notes, and snippets.

View Charlesmendez's full-sized avatar

Carlos Mendez Charlesmendez

View GitHub Profile
@Charlesmendez
Charlesmendez / main.py
Last active December 15, 2023 14:09
Public IEX code
import pandas as pd
import requests
import time
from datetime import datetime
from ide_utils.input_tables import load_dask
from ide_utils.output_table import send_to_output_table
API_TOKEN = "YOUR TOKEN"
base_url = "https://cloud.iexapis.com/v1"
endpoint = "/stock/{}/chart"
@Charlesmendez
Charlesmendez / regex.js
Created December 4, 2022 20:43
Java Script Regex
const sourceCodeWithCompletion = fileTextToCursor + completion;
const sourceCodeArr = sourceCodeWithCompletion.split('\n')
const completionArr = completion.split('\n');
const regex = new RegExp(completionArr, 'g');
// loop through the completionArray and apply the decoration to the text
for (let line = 0; line < sourceCodeArr.length; line++) {
// loop through each line of the regex
for (let lineRegex = 0; lineRegex < completionArr.length; lineRegex++) {
@Charlesmendez
Charlesmendez / error.ts
Last active November 30, 2022 16:18
TimeOut firbase error
import {QueryDocumentSnapshot} from "@google-cloud/firestore";
import * as functions from "firebase-functions";
import {EventContext} from "firebase-functions";
import {Storage} from "@google-cloud/storage";
export const shareToAnotherGraph = async (snap: QueryDocumentSnapshot, _context: EventContext, db: FirebaseFirestore.Firestore) => {
const data = snap.data();
// The ID of your GCP project
const projectId = "xx";
// The ID of the bucket the original object is in
@Charlesmendez
Charlesmendez / copyFile.ts
Last active October 19, 2022 13:25
Typescript script to copy a file in a bucket and pastes it in another path
import {QueryDocumentSnapshot} from "@google-cloud/firestore";
import * as functions from "firebase-functions";
import {EventContext} from "firebase-functions";
import {Storage} from "@google-cloud/storage";
export const shareToAnotherGraph = async (snap: QueryDocumentSnapshot, _context: EventContext, db: FirebaseFirestore.Firestore) => {
const data = snap.data();
// The ID of your GCP project
const projectId = "example";
// The ID of the bucket the original object is in
@Charlesmendez
Charlesmendez / ArrayBag.java
Last active December 10, 2021 22:24
Harvard Data Structures
package bag;
/*
* ArrayBag.java
*
* Computer Science E-22
*
* Modified by: <your name>, <your e-mail address>
*/
import java.util.*;
@Charlesmendez
Charlesmendez / credit.c
Last active April 8, 2021 02:16
CS50 Problem Sets *SOLVED
#include <cs50.h>
#include <stdio.h>
int main(void)
{
// prompts the user for a credit card number
long num;
num = get_long("Enter card number: ");