Skip to content

Instantly share code, notes, and snippets.

View crrmacarse's full-sized avatar

Macarse, Christian Ryan R. crrmacarse

View GitHub Profile
@crrmacarse
crrmacarse / analyze_money_manager.py
Last active May 4, 2025 14:18
analyze_money_manager.py
import re
from openpyxl import load_workbook
from pprint import pprint
from datetime import datetime
from utils.helpers import write_to_file
def process_coffee_shops(food_data):
coffee_shops = [
"Starbucks", "Dunkin Donuts", "Pickup Coffee", "Coffee Project",
"Tim Hortons", "Dean & Deluca", "Cafe Amazon", "Highlands", "Bo's"
@crrmacarse
crrmacarse / cc-analyzer.py
Created May 3, 2025 06:03
cc-analyzer.py
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import argparse
from PyPDF2 import PdfReader
import re
from gspread_formatting import format_cell_range, CellFormat, TextFormat
#TODO:
# - Integrate moneymanager which is a backup
@crrmacarse
crrmacarse / is-weather-good-here.py
Created May 3, 2025 06:02
is-weather-good-here.py
from dotenv import load_dotenv
import os
import googlemaps
import argparse
import requests
from pprint import pprint
load_dotenv()
def get_coordinates(location):
import nodemailer from 'nodemailer'
import Env from '@ioc:Adonis/Core/Env'
export const emailConfig = {
rootUrl: Env.getOrFail('PUBLIC_URL') as string,
service: Env.getOrFail('SMPT_SERVICE') as string,
user: Env.getOrFail('SMPT_USER') as string,
pass: Env.getOrFail('SMPT_PASSWORD') as string,
}
import * as AWS from 'aws-sdk'
import Env from '@ioc:Adonis/Core/Env'
import { v4 as uuid } from 'uuid'
import { ManagedUpload } from 'aws-sdk/clients/s3'
const AWS_BUCKET_NAME = Env.getOrFail('AWS_BUCKET_NAME') as string
const AWS_REGION = Env.getOrFail('AWS_REGION') as string
const AWS_SECRET_ACCESS_KEY = Env.getOrFail('AWS_SECRET_ACCESS_KEY') as string
const AWS_ACCESS_KEY_ID = Env.getOrFail('AWS_ACCESS_KEY_ID') as string
@crrmacarse
crrmacarse / ck-editor-react.tsx
Last active October 16, 2020 02:44
How add ts-ignore in jsx
<FormControl
{...otherProps}
variant="outlined"
fullWidth
>
<Field name={name}>
{({ input, meta: { touched, error, submitError } }) => (
<Fragment>
<FormLabel>{label}</FormLabel>
{/*
@crrmacarse
crrmacarse / useEffect.ts
Last active May 19, 2020 15:31
Limit trigger of useEffect ala componentDidUpdate behaviour
const isInitialMount = useRef(true);
const [search, setSearch] = useState<string>();
// https://stackoverflow.com/questions/55075604/react-hooks-useeffect-only-on-update
useEffect(() => {
let debounceFunc: NodeJS.Timeout;
if (isInitialMount.current) {
isInitialMount.current = false;
} else {
import React, { useState, useEffect } from 'react';
import { Backdrop, CircularProgress, Typography, Box } from '@material-ui/core';
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) => createStyles({
backdrop: {
zIndex: theme.zIndex.drawer + 1,
background: '#0000001f',
},
title: {
@crrmacarse
crrmacarse / index.tsx
Created May 15, 2020 02:25
Preloading
import 'providers/message';
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import 'raf/polyfill';
import 'scss/index.scss';
import 'providers/sentry';
import React from 'react';
import { hydrate } from 'react-dom';
import { Provider as ReduxProvider } from 'react-redux';
import Providers from 'providers';
$font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
$font-family: "Poppins", $font-system;